All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
From: Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com>
To: Alexander Ivanov <alexander.ivanov@virtuozzo.com>, den@openvz.org
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.1 v5 0/3] dm-qcow2: truncate unused tail of image on suspend
Date: Mon, 12 Oct 2026 11:59:55 +0200	[thread overview]
Message-ID: <26a23677-579a-4be1-8119-4ab2453262e5@virtuozzo.com> (raw)
In-Reply-To: <20261010124642.927044-1-alexander.ivanov@virtuozzo.com>

Reviewed-by: Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com>

On 10/10/26 14:46, Alexander Ivanov wrote:
> 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. Close and
> reload to RO go through postsuspend too, so the tail is given back in
> these cases as well.
> 
> 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
> 
> v5:
> - Add Reviewed-by line.
> 
> v4:
> - Patch 1: document in the comment that the caller must ensure no read
>    of the page is in flight.
> - Patch 3: say in the commit message that close and reload to RO go
>    through postsuspend too.
> 
> 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 | 83 +++++++++++++++++++++++++++---------
>   drivers/md/dm-qcow2.h        |  3 ++
>   3 files changed, 121 insertions(+), 21 deletions(-)
> 

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

      parent reply	other threads:[~2026-10-12 10:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-10 12:46 Alexander Ivanov
2026-10-10 12:46 ` [Devel] [PATCH hci-8.1 v5 1/3] dm-qcow2: add qcow2_md_page_read_sync() helper Alexander Ivanov
2026-10-10 12:51   ` no-reply
2026-10-10 12:46 ` [Devel] [PATCH hci-8.1 v5 2/3] dm-qcow2: drop duplicate prefix from QC_ERR/QC_INFO messages Alexander Ivanov
2026-10-10 12:50   ` no-reply
2026-10-10 12:46 ` [Devel] [PATCH hci-8.1 v5 3/3] dm-qcow2: truncate unused tail of image on suspend Alexander Ivanov
2026-10-10 12:53   ` no-reply
2026-10-12  9:35   ` Andrey Zhadchenko
2026-10-12  9:59 ` Andrey Zhadchenko [this message]

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=26a23677-579a-4be1-8119-4ab2453262e5@virtuozzo.com \
    --to=andrey.zhadchenko@virtuozzo.com \
    --cc=alexander.ivanov@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.