From: Konstantin Khorenko <khorenko@virtuozzo.com>
To: "Denis V. Lunev" <den@openvz.org>
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.1 2/2] dm-ploop: fix flip_upper_deltas walking past the BAT of the lower delta
Date: Thu, 05 Nov 2026 13:58:48 +0100 [thread overview]
Message-ID: <179388352809.2823727.15310964921493787995.b4-review@b4> (raw)
In-Reply-To: <20261104214635.2063009-3-den@openvz.org>
I won't apply this version, please send v2 with the changes below.
On Wed, 04 Nov 2026 22:46:35 +0100, Denis V. Lunev wrote:
> - clu = ploop_page_clu_idx_to_bat_clu(md->id, i);
> + clu = ploop_page_clu_idx_to_bat_clu(md->id, end);
> if (clu == nr_be - 1) {
> stop = true;
> goto unmap;
- refuse the flip when the lower delta covers fewer BAT entries than
the device (nr_be read from its header < ploop->nr_bat_entries),
outside #ifdef PLOOP_DEBUG; keep the `end` fix;
- fix "the stop never matches" in the message and split its first
paragraph;
- optional: `goto unmap` now jumps to the next line, a plain `break`
does the same.
Item 2 of the cover letter reply. With the `end` fix the check returns
0 and the flip completes with a new top whose BAT is smaller than the
device's. After resume the BAT writeback puts the grown header into
page 0 of that file and the BAT pages past its old size onto its data
clusters, so the image no longer opens. Before the patch this flip
oopsed, now it damages the image silently. Compare entries, not pages:
fewer entries in the same number of pages gives a stack that
ploop_add_delta() refuses on the next load.
> after the scan of the page, when i is already one past end, so the stop
> never matches. Once the live BAT has more pages than the lower delta, as
Item 3 of the cover letter reply. On a full page i == end + 1 is the
first entry of the next page, so the old check matches when nr_be + 15
is a multiple of 1024 (nr_be = 1009, for example). The walk then stops
one page early and skips entry nr_be - 1. The patch fixes that too,
the message should say so. The paragraph has six sentences: the bug,
the oops and why the library does not get there are three paragraphs.
--
Konstantin Khorenko,
Virtuozzo Linux Kernel Team
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
next prev parent reply other threads:[~2026-11-05 13:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 21:46 [Devel] [PATCH hci-8.1 0/2] dm-ploop: fix flip_upper_deltas panicking the host in its pre-flip check Denis V. Lunev
2026-11-04 21:46 ` [Devel] [PATCH hci-8.1 1/2] dm-ploop: fix flip_upper_deltas returning with two md_locks held Denis V. Lunev
2026-11-04 21:50 ` no-reply
2026-11-05 12:58 ` Konstantin Khorenko
2026-11-04 21:46 ` [Devel] [PATCH hci-8.1 2/2] dm-ploop: fix flip_upper_deltas walking past the BAT of the lower delta Denis V. Lunev
2026-11-04 21:50 ` no-reply
2026-11-05 12:58 ` Konstantin Khorenko [this message]
2026-11-05 12:36 ` [Devel] [PATCH hci-8.1 0/2] dm-ploop: fix flip_upper_deltas panicking the host in its pre-flip check Andrey Zhadchenko
2026-11-05 12:58 ` Konstantin Khorenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179388352809.2823727.15310964921493787995.b4-review@b4 \
--to=khorenko@virtuozzo.com \
--cc=den@openvz.org \
--cc=devel@openvz.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox