All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
* [PATCH hci-8.1 0/1] qcow2: fix guest TRIM destroying internal snapshot data #VSTOR-144873
@ 2026-10-26 19:37 Denis V. Lunev
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Denis V. Lunev @ 2026-10-26 19:37 UTC (permalink / raw)
  To: andrey.drobyshev; +Cc: svt-core, den

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-10-27  9:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-26 19:37 [PATCH hci-8.1 0/1] qcow2: fix guest TRIM destroying internal snapshot data #VSTOR-144873 Denis V. Lunev
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

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.