OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
* [Devel] [PATCH hci-8.1 v3 0/3] dm-qcow2: truncate unused tail of image on suspend
@ 2026-10-08 10:04 Alexander Ivanov
  2026-10-08 10:04 ` [Devel] [PATCH hci-8.1 v3 1/3] dm-qcow2: add qcow2_md_page_read_sync() helper Alexander Ivanov
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Alexander Ivanov @ 2026-10-08 10:04 UTC (permalink / raw)
  To: den; +Cc: devel

On postsuspend dm-qcow2 truncates the image file only down to
file_preallocated_area_start, so clusters at the end of the file freed
by discard are never given back and the file never shrinks.

This series makes postsuspend scan the refcount blocks backward and
truncate the file to the end of the last used cluster.

Patch 1 adds qcow2_md_page_read_sync() helper, which is needed by the
scan. Patch 2 is a small cleanup of duplicate prefixes in QC_ERR/QC_INFO
messages. Patch 3 does the actual truncation.

https://virtuozzo.atlassian.net/browse/VSTOR-148171

v3:
- Split from the common series with dm-ploop: dm-ploop patches are
  sent as a separate series.
- Patch 1: rename qcow2_get_md_page_sync() to qcow2_md_page_read_sync(),
  reword commit message and comment.
- Patch 2: new patch.
- Patch 3: start the scan from file_preallocated_area_start instead of
  the end of the file and clamp the result to it, as the last cluster
  may be partial; print the scan error with %pe and drop the duplicate
  "dm-qcow2:" prefix from it.

v2:
- Add dm-ploop support (patches 3-6), as requested in v1 review.
- dm-qcow2: move get_md_page_sync() to a separate patch as
  qcow2_md_page_read_sync() and use it in qcow2_parse_header() as well.
- dm-qcow2: start the refcount scan below file_preallocated_area_start
  instead of the end of the file, and truncate to the used end directly
  instead of min(file_preallocated_area_start, used end).

Alexander Ivanov (3):
  dm-qcow2: add qcow2_md_page_read_sync() helper
  dm-qcow2: drop duplicate prefix from QC_ERR/QC_INFO messages
  dm-qcow2: truncate unused tail of image on suspend

 drivers/md/dm-qcow2-map.c    | 56 ++++++++++++++++++++++++++
 drivers/md/dm-qcow2-target.c | 78 ++++++++++++++++++++++++++----------
 drivers/md/dm-qcow2.h        |  3 ++
 3 files changed, 116 insertions(+), 21 deletions(-)

-- 
2.53.0

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

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

end of thread, other threads:[~2026-10-08 11:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-08 10:04 [Devel] [PATCH hci-8.1 v3 0/3] dm-qcow2: truncate unused tail of image on suspend Alexander Ivanov
2026-10-08 10:04 ` [Devel] [PATCH hci-8.1 v3 1/3] dm-qcow2: add qcow2_md_page_read_sync() helper Alexander Ivanov
2026-10-08 10:09   ` no-reply
2026-10-08 10:57   ` Denis V. Lunev
2026-10-08 10:04 ` [Devel] [PATCH hci-8.1 v3 2/3] dm-qcow2: drop duplicate prefix from QC_ERR/QC_INFO messages Alexander Ivanov
2026-10-08 10:07   ` no-reply
2026-10-08 10:04 ` [Devel] [PATCH hci-8.1 v3 3/3] dm-qcow2: truncate unused tail of image on suspend Alexander Ivanov
2026-10-08 10:11   ` no-reply
2026-10-08 10:58   ` Denis V. Lunev
2026-10-08 10:59 ` [Devel] [PATCH hci-8.1 v3 0/3] " Denis V. Lunev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox