From: "Denis V. Lunev" <den@openvz.org>
To: andrey.drobyshev@virtuozzo.com
Cc: svt-core@virtuozzo.com, den@openvz.org
Subject: [PATCH hci-8.1 0/1] qcow2: fix guest TRIM destroying internal snapshot data #VSTOR-144873
Date: Mon, 26 Oct 2026 20:37:14 +0100 [thread overview]
Message-ID: <20261026193715.828224-1-den@openvz.org> (raw)
With extended_l2=on, a discard of part of a cluster that an internal
snapshot still references punches the host range under it. The snapshot
then reads zeroes there, and qemu-img check finds nothing wrong. Every
VM disk has discard='unmap' and the image cache uses cluster_size=1M,
extended_l2=on, so a guest TRIM after a snapshot is enough: CI reverts
gave Windows guests partially zeroed files and left SLES btrfs guests
unbootable.
The bug comes with our "qcow2: make subclusters discardable" series,
which is not upstream. The patch passes the discard to the host only
for clusters owned by the active layer alone, and adds a case to
iotest 271.
iotest 271 on dev-cl04 fails without the fix (the snapshot reads zeroes
after revert) and passes with it.
Signed-off-by: Denis V. Lunev <den@openvz.org>
Denis V. Lunev (1):
qcow2: fix subcluster discard punching data shared with a snapshot
#VSTOR-144873
block/qcow2-cluster.c | 10 +++++++---
tests/qemu-iotests/271 | 18 ++++++++++++++++++
tests/qemu-iotests/271.out | 5 +++++
3 files changed, 30 insertions(+), 3 deletions(-)
base-commit: 9ad1f5893c80aa612f78cb40c4c8690097ebb9e9
--
2.53.0
next reply other threads:[~2026-10-26 19:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-26 19:37 Denis V. Lunev [this message]
2026-10-26 19:37 ` [PATCH hci-8.1 1/1] qcow2: fix subcluster discard punching data shared with a snapshot #VSTOR-144873 Denis V. Lunev
2026-10-27 9:21 ` Andrey Drobyshev
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=20261026193715.828224-1-den@openvz.org \
--to=den@openvz.org \
--cc=andrey.drobyshev@virtuozzo.com \
--cc=svt-core@virtuozzo.com \
/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.