> From: Denis V. Lunev <[email protected]> > > relocate_refcount_table() inserts md pages for the last cluster of the > new reftable and for the new refblocks, one page at a time from > pos + old_clus * clu_size up to r2_end. On error it frees pages from > end only, one per cluster, so the pages of the new reftable cluster > and all but the first page of each refblock cluster bigger than a page > stay in md_pages. > > The header is rolled back, so the next allocation past the old refcount > coverage relocates the table again. Its first insert finds a leaked page > and fails with -EEXIST, the relocation returns -EIO, and every > allocating write beyond the old coverage fails with an I/O error until > the device is suspended and resumed or the table is reloaded. A failed > page allocation or a failed header write is enough to get there. > > Free exactly the pages the allocation loop inserted when the relocation > fails before the header write. Once the header write has succeeded, the > error paths skip the freeing and only return -EIO: the header on disk > already points at the new table, and its pages may be dirty and queued > for writeback by then. > > Fixes: 222b6f1291c1 ("dm-qcow2: Introduce driver to create block devices over > QCOW2 files") > https://virtuozzo.atlassian.net/browse/VSTOR-153051 > Feature: dm-qcow2: block device over QCOW2 files driver > Signed-off-by: Denis V. Lunev <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great! -- Sashiko AI review ยท https://sashiko.vzint.dev/#/patchset/[email protected]?part=1 _______________________________________________ Devel mailing list [email protected] https://lists.openvz.org/mailman/listinfo/devel
