[Devel] [PATCH hci-8.1 v9 07/10] dm-qcow2: fix md page cleanup on failed reftable relocation
no-reply at sashiko.virtuozzo.com
no-reply at sashiko.virtuozzo.com
Wed Oct 28 18:16:08 MSK 2026
> relocate_refcount_table() inserts an md page for every page of the new
> reftable tail and of the new refblocks, starting at
> pos + old_clus * clu_size, but its error path erases only one page per
> cluster starting at end. The remaining pages stay in qcow2->md_pages.
> Since a failed relocation leaves the header and reftable_max_file_size
> unchanged, the next relocation picks the same pos, gets -EEXIST from
> md_page_try_insert() and fails with -EIO. So a single -ENOMEM or header
> write error makes every later relocation fail until the target is
> reloaded.
>
> Erase every page the allocation loop inserted.
>
> Failures after the in-memory header is switched to the new reftable
> also jumped there. At that point the new pages back the live reftable
> and may be dirty and linked in slow_wb_batch_list, so freeing them
> leaves writeback with freed pages. Just return -EIO on these paths, as
> freeing with the fixed range would also free the dirty reftable tail.
>
> https://virtuozzo.atlassian.net/browse/VSTOR-148171
> Feature: dm-qcow2: block device over QCOW2 files driver
>
> Signed-off-by: Alexander Ivanov <alexander.ivanov at virtuozzo.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261028150645.3222391-1-alexander.ivanov@virtuozzo.com?part=7
More information about the Devel
mailing list