All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
From: no-reply@sashiko.virtuozzo.com
To: andrey.zhadchenko@virtuozzo.com, "Denis V. Lunev" <den@openvz.org>
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.1 v3 1/5] dm-qcow2: fix a failed refcount table relocation leaking md pages
Date: Wed, 4 Nov 2026 18:52:54 +0000	[thread overview]
Message-ID: <010701a1a7e83184-d8346baf-9c0a-4a93-9d24-879dc3bfa240-000000@eu-central-1.amazonses.com> (raw)
In-Reply-To: <20261104180105.1807820-2-den@openvz.org>

> From: Denis V. Lunev <den@openvz.org>
> 
> 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 <den@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=1


_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

  reply	other threads:[~2026-11-04 18:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-04 18:01 [Devel] [PATCH hci-8.1 v3 0/5] dm-qcow2: fix merges not stopping the users of the images they change Denis V. Lunev
2026-11-04 18:01 ` [Devel] [PATCH hci-8.1 v3 1/5] dm-qcow2: fix a failed refcount table relocation leaking md pages Denis V. Lunev
2026-11-04 18:52   ` no-reply [this message]
2026-11-04 18:01 ` [Devel] [PATCH hci-8.1 v3 2/5] dm-qcow2: fix backward merge of an inner image racing its reads Denis V. Lunev
2026-11-04 18:52   ` no-reply
2026-11-04 18:01 ` [Devel] [PATCH hci-8.1 v3 3/5] dm-qcow2: fix SEEK_HOLE/SEEK_DATA using an image freed by a merge Denis V. Lunev
2026-11-04 18:54   ` no-reply
2026-11-04 18:01 ` [Devel] [PATCH hci-8.1 v3 4/5] dm-qcow2: fix SEEK_HOLE/SEEK_DATA hanging after a failed metadata read Denis V. Lunev
2026-11-04 18:55   ` no-reply
2026-11-04 18:01 ` [Devel] [PATCH hci-8.1 v3 5/5] dm-qcow2: fix a refcount table relocation failing on a valid image Denis V. Lunev
2026-11-04 18:55   ` no-reply
2026-11-04 18:30 ` [Devel] [PATCH hci-8.1 v3 0/5] dm-qcow2: fix merges not stopping the users of the images they change Konstantin Khorenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=010701a1a7e83184-d8346baf-9c0a-4a93-9d24-879dc3bfa240-000000@eu-central-1.amazonses.com \
    --to=no-reply@sashiko.virtuozzo.com \
    --cc=andrey.zhadchenko@virtuozzo.com \
    --cc=den@openvz.org \
    --cc=devel@openvz.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.