[Devel] [PATCH hci-8.2 v2 8/8] dm-qcow2: flush the backward merge work before freeing the target

no-reply at sashiko.virtuozzo.com no-reply at sashiko.virtuozzo.com
Mon Nov 23 18:48:40 MSK 2026


> From: Denis V. Lunev <den at openvz.org>
> 
> qcow2_merge_backward_work() runs on the system workqueue and ends by
> setting the merge state under ctl_mutex and unlocking it. A
> qcow2_merge_backward_cancel() that sees BACKWARD_MERGE_STOPPED, or
> turns BACKWARD_MERGE_WAIT_COMPLETION into it, returns without
> flush_work(), so it can take ctl_mutex while the work is still inside
> mutex_unlock(). qcow2_tgt_destroy() then frees the target, and the
> mutex in it, under that unlock.
> 
> Flush the merge work in qcow2_tgt_destroy() after the cancel,
> whatever state the merge is in.
> 
> https://virtuozzo.atlassian.net/browse/VSTOR-156036
> 
> Fixes: 7d2cf9a7c178 ("dm-qcow2: make merge_backward command asyncronous")
> 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=8




More information about the Devel mailing list