[Devel] [PATCH hci-8.1 v3 5/5] dm-qcow2: fix a refcount table relocation failing on a valid image
no-reply at sashiko.virtuozzo.com
no-reply at sashiko.virtuozzo.com
Wed Nov 4 21:55:51 MSK 2026
> From: Denis V. Lunev <den at openvz.org>
>
> relocate_refcount_table() puts the new reftable at pos, the start of
> the first refcount group the old table does not cover, and the new
> refblocks right after it. It then gives each new refblock to the group
> the refblock itself sits in. When the new reftable fills the group of
> pos by itself, the refblocks all land in the next group, and the group
> of pos gets none. Marking the reftable clusters used then fails with a
> WARN, and every allocating write past the old refcount coverage fails
> with EIO.
>
> A valid image gets there: with 4K clusters and refcount_bits=64 a
> refcount group is 512 clusters, and the reftable reaches 512 clusters
> when the image file grows to about 511G; with refcount_bits=32, at
> about 2T.
>
> Give the new refblocks to the groups the new reftable and refblocks
> span, one each, in order. pos is group-aligned, and r2_clus is computed
> for the refblocks to count both themselves and the new table, so there
> is a refblock for each of these groups.
>
> Fixes: 222b6f1291c1 ("dm-qcow2: Introduce driver to create block devices over QCOW2 files")
> Reported-by: Konstantin Khorenko <khorenko at virtuozzo.com>
> https://virtuozzo.atlassian.net/browse/VSTOR-153421
> 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. It looks great!
--
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261104180105.1807820-1-den@openvz.org?part=5
More information about the Devel
mailing list