[Devel] [PATCH hci-8.2 v2 2/8] dm-qcow2: fix do_qio_endio() freeing a qio into a destroyed pool

no-reply at sashiko.virtuozzo.com no-reply at sashiko.virtuozzo.com
Mon Nov 23 18:41:00 MSK 2026


> From: Denis V. Lunev <den at openvz.org>
> 
> do_qio_endio() calls the endio callback, drops the qio's inflight
> reference and only then frees a QIO_FREE_ON_ENDIO_FL qio into
> tgt->qio_pool. Either of the first two can end the last user of the
> target: a split qio's callback completes its parent request, whose
> reference goes, and a metadata page read drops its own reference.
> Suspend then finishes, and a dmsetup remove destroys the pool before
> the free runs from the backing file system's completion context, which
> oopses in mempool_free().
> 
> Free the qio first, then call the callback, then drop the reference,
> so that nothing touches the target after the last of them. Read the
> qio's fields once its last completion has arrived, as children write
> the status of their parent up to then.
> 
> 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=2




More information about the Devel mailing list