[Devel] [PATCH hci-8.2 1/2] dm-qcow2: decompress compressed clusters merged into the lower image

no-reply at sashiko.virtuozzo.com no-reply at sashiko.virtuozzo.com
Thu Nov 19 17:39:03 MSK 2026


> From: Denis V. Lunev <den at openvz.org>
> 
> During a backward merge, process_one_qio() sends each merge qio of the
> top image to submit_top_delta_read() before it checks map.compressed.
> That read takes clu_size bytes from the compressed data offset, and
> process_backward_merge_write() writes them into the lower image as a
> plain cluster. After the merge the device returns the compressed
> stream, and whatever follows it in the file, instead of the data, and
> qemu-img check finds nothing wrong. If the raw read runs past the end
> of the top image, the merge fails with -EIO instead, or never ends on
> a kernel that resubmits a 0-byte read.
> 
> A guest write to a compressed cluster during the merge takes the same
> path, and so does a guest read, which becomes a merge qio first.
> 
> Read such a cluster with submit_read_compressed(), as a COW does, but
> with the copy mask of the merge and new_ext_l2 left 0 for the discard
> of the top entry, and pass the decompressed slices on to the merge
> write instead of the COW write.
> 
> https://virtuozzo.atlassian.net/browse/VSTOR-156064
> 
> 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/20261119143026.998715-2-den@openvz.org?part=1




More information about the Devel mailing list