[Devel] [PATCH hci-8.2 v2 6/8] dm-qcow2: stop slow_wb_timer and flush the workers before freeing an image
no-reply at sashiko.virtuozzo.com
no-reply at sashiko.virtuozzo.com
Mon Nov 23 18:45:37 MSK 2026
> From: Denis V. Lunev <den at openvz.org>
>
> qcow2_flush_deferred_activity() ends with an inflight reference switch
> that waits for the metadata writeback it started. Those qios are ended
> by the image's fsync_worker, and each completion queues that worker
> before the qio is taken, so one run can end the last qio while another
> run stays queued. qcow2_merge_backward_complete() then frees the merged
> image with that work still pending, and it runs on freed memory.
>
> Shut slow_wb_timer down and flush both workers of the merged image
> before truncating and freeing it. The timer is not expected to be armed
> after the final flush pass, which writes without retrying on ENOSPC,
> but qcow2_destroy() only warns about a pending one. In
> qcow2_tgt_destroy(), shut down the timer of every image before
> destroy_workqueue() drains the remaining work, for the same reason.
>
> https://virtuozzo.atlassian.net/browse/VSTOR-156036
>
> Fixes: 222b6f1291c1 ("dm-qcow2: Introduce driver to create block devices over QCOW2 files")
> Feature: dm-qcow2: block device over QCOW2 files driver
> Signed-off-by: Denis V. Lunev <den at openvz.org>
Sashiko has reviewed this patch and found no issues.
Carry the trailer below into the next revision and Sashiko will not review this patch again.
Reviewed-by: Sashiko <no-reply at sashiko.virtuozzo.com>
--
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261123153640.128227-1-den@openvz.org?part=6
More information about the Devel
mailing list