[Devel] [PATCH hci-8.1 v2 2/7] dm-qcow2: wait for L2 writeback in perform_rw_mapped()
no-reply at sashiko.virtuozzo.com
no-reply at sashiko.virtuozzo.com
Tue Nov 10 14:56:45 MSK 2026
> perform_rw_mapped() reads md->status and md->wbd without
> md_pages_lock, relying on dm-qcow2 sequential nature: L1/L2 pages
> become dirty, go to writeback and drop md->wbd from main kwork only.
> Expand md_pages_lock to also cover the check, so it can be called
> from the per-qio fast path in parallel with main kwork.
>
> The lock alone is not enough. parse_l2() does not delay a write to
> a changed index of a DIRTY L2 page, as perform_rw_mapped() is going
> to attach the write to md->wbd. Main kwork does parse, submit and the
> DIRTY -> WRITEBACK switch in one do_qcow2_work() pass, so the page
> is still DIRTY there. The fast path parses and submits under separate
> lock holds, and main kwork may switch the page to WRITEBACK in
> between:
>
> main kwork fast worker
> [ ... ]
> delayed such writes in the same pass.
>
> https://virtuozzo.atlassian.net/browse/VSTOR-95494
> Feature: dm-qcow2: block device over QCOW2 files driver
> Signed-off-by: Andrey Zhadchenko <andrey.zhadchenko at virtuozzo.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261110114629.416695-1-andrey.zhadchenko@virtuozzo.com?part=2
More information about the Devel
mailing list