[Devel] [PATCH hci-8.1 0/2] dm-ploop, dm-qcow2: fix merge status shared by all devices

Andrey Zhadchenko andrey.zhadchenko at virtuozzo.com
Wed Oct 28 15:56:50 MSK 2026


Patches are great but BUG_ON chunks are completely useless. Let's not 
add junk. Remove them please.

Other than that,
Reviewed-by: Andrey Zhadchenko <andrey.zhadchenko at virtuozzo.com>

On 10/27/26 18:49, Denis V. Lunev wrote:
> dm-ploop and dm-qcow2 collect the status of their merge service I/O in
> a function-local static, so every device on the host shares one copy.
> 
> In dm-ploop it is never reset: after a single failed fake merge pio,
> every later online merge on any ploop device stops after its first pio
> and returns that old error until the module is reloaded, which on a
> working node means a reboot.
> 
> dm-qcow2 resets it when each run starts, which makes it worse: a merge
> or L1 COW break starting on one device wipes the error another device
> has just recorded. That merge then reports success although a write
> failed, userspace completes it and drops the top image, and the data
> that never reached the lower image is gone.
> 
> The status goes on the stack. The pios/qios carry a pointer to it, so
> both loops must not return while one is outstanding: every exit
> already waits for the counter to drain, and a BUG_ON after the wait
> stops the kernel rather than let a late pio/qio write into a dead
> stack frame if that ever changes.
> 
> Tested on dev-cl04, 6.12.0-211.52.1.22.9.vz10 with the modules built
> out of tree, using test-only module knobs to fail one service pio/qio:
> - dm-ploop: after one injected failure, a merge on another device and a
>    second merge on the same device both failed with EIO; with the fix
>    both succeed;
> - dm-qcow2: a backward merge with an injected qio error, held for 5 s
>    while a merge on a second device started, returned success; with the
>    fix it fails with "Can't break L1 COW";
> - the ploop pytest suite, ploop and qcow2 formats, passes.
> 
> Denis V. Lunev (2):
>    dm-ploop: fix a failed merge failing every later merge on the host
>    dm-qcow2: fix a merge reporting success after a failed write
> 
>   drivers/md/dm-ploop-cmd.c | 4 +++-
>   drivers/md/dm-qcow2-cmd.c | 6 +++---
>   2 files changed, 6 insertions(+), 4 deletions(-)
> 
> 
> base-commit: 02401c5e378f282fbf11bdc65996253ff65dad9b



More information about the Devel mailing list