[Devel] [PATCH hci-8.1 v11 04/10] dm-qcow2: complete wbd before ending the data qio
no-reply at sashiko.virtuozzo.com
no-reply at sashiko.virtuozzo.com
Mon Nov 9 17:09:44 MSK 2026
> data_rw_complete() calls qio_endio() before complete_wbd(). qio_endio()
> drops the inflight ref, so qcow2_flush_deferred_activity() may return
> on suspend while complete_wbd() for a failed L1/L2 writeback is still
> running in AIO completion context. revert_l_entries_update() then
> marks clusters unused and dirties an R2 page after the flush.
>
> That page sits on slow_wb_batch_list with the slow writeback timer
> armed. If the timer fires first, the page is written while the device
> is suspended, after postsuspend has cleared the dirty bit. If
> preresume comes first, qcow2_free_md_pages_all() frees the page
> without taking it off the list, and the timer later walks freed
> memory.
>
> Complete the wbd first, so the R2 update is in place before the
> inflight ref goes away and the suspend flush writes it back. The md
> writeback path already does it in this order.
>
> https://virtuozzo.atlassian.net/browse/VSTOR-148171
> Feature: dm-qcow2: block device over QCOW2 files driver
> Fixes: 222b6f1291c1c ("dm-qcow2: Introduce driver to create block devices over QCOW2 files")
>
> Signed-off-by: Alexander Ivanov <alexander.ivanov at virtuozzo.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261109140143.1408038-2-alexander.ivanov@virtuozzo.com?part=4
More information about the Devel
mailing list