[Devel] [PATCH hci-8.1 0/2] dm-ploop: fix flip_upper_deltas panicking the host in its pre-flip check

Andrey Zhadchenko andrey.zhadchenko at virtuozzo.com
Thu Nov 5 15:36:13 MSK 2026


Reviewed-by: Andrey Zhadchenko <andrey.zhadchenko at virtuozzo.com>

On 11/4/26 22:46, Denis V. Lunev wrote:
> ploop_check_delta_before_flip() runs on every flip_upper_deltas, as
> PLOOP_DEBUG is always defined in dm-ploop-cmd.c, and both of its ways
> out of the walk are broken (VSTOR-153445):
> 
> - patch 1: when it finds a cluster both deltas map, it returns -EEXIST
>    with two md_locks held and interrupts disabled. The next pio on that
>    BAT page spins on the lock forever, and the host panics on a hard
>    lockup;
> 
> - patch 2: the walk never stops at the end of the BAT of the lower
>    delta, so once the device has grown past it the flip oopses on a NULL
>    md page.
> 
> Neither is reached through the ploop library. Its reverse merge, the
> only sender of the flip, grows the lower delta to the size of the top
> and clears the clusters both deltas map before it flips, and a device it
> mounted has the lower delta read-only, which the flip refuses with
> EACCES before the check. Both take a flip of a table built with the
> lower delta read-write, so VSTOR-153445 has no RK for 8.0. This is the
> fix the v2 cover letter of "dm-ploop: fix the pio submission stop around
> cmds" said would be sent separately.
> 
> Tested on dev-cl04, stock 6.12.0-211.52.1.22.11.vz10, dm-ploop built
> out of tree with the series on top of the applied dm-ploop v2:
> - a chain whose top delta overwrote clusters of the base and a direct
>    flip_upper_deltas: the stock module returns to dmsetup in atomic
>    context ("BUG: scheduling while atomic"), and a read of the device
>    then panics the host with "Hard LOCKUP". With the series the message
>    fails with EEXIST and the device keeps working;
> - set_noresume, suspend, a grow to 2T and flip_upper_deltas: the stock
>    module oopses at ploop_check_delta_before_flip+0x86, with the series
>    the flip completes and the images keep their data;
> - the ploop pytest suite, ploop format, passes.
> 
> Denis V. Lunev (2):
>    dm-ploop: fix flip_upper_deltas returning with two md_locks held
>    dm-ploop: fix flip_upper_deltas walking past the BAT of the lower
>      delta
> 
>   drivers/md/dm-ploop-cmd.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> 
> base-commit: 1f21db982845109040d1feb279e9ee34f8e6f065



More information about the Devel mailing list