qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Hanna Czenczek <hreitz@redhat.com>
To: Jean-Louis Dupond <jean-louis@dupond.be>,
	qemu-devel@nongnu.org, kwolf@redhat.com
Subject: Re: [PATCH v2] qcow2: keep reference on zeroize with discard-no-unref enabled
Date: Fri, 15 Sep 2023 13:21:00 +0200	[thread overview]
Message-ID: <1088caf4-3f59-84be-25d4-f2574674cb2a@redhat.com> (raw)
In-Reply-To: <20230905130839.923041-2-jean-louis@dupond.be>

On 05.09.23 15:08, Jean-Louis Dupond wrote:
> When the discard-no-unref flag is enabled, we keep the reference for
> normal discard requests.
> But when a discard is executed on a snapshot/qcow2 image with backing,
> the discards are saved as zero clusters in the snapshot image.
>
> When committing the snapshot to the backing file, not
> discard_in_l2_slice is called but zero_in_l2_slice. Which did not had
> any logic to keep the reference when discard-no-unref is enabled.
>
> Therefor we add logic in the zero_in_l2_slice call to keep the reference
> on commit.
>
> Fixes: https://gitlab.com/qemu-project/qemu/-/issues/1621
> Signed-off-by: Jean-Louis Dupond <jean-louis@dupond.be>
> ---
>   block/qcow2-cluster.c | 22 ++++++++++++++++++----
>   1 file changed, 18 insertions(+), 4 deletions(-)

The code looks OK, but the obvious problem I find is that this is not 
what the discard-no-unref option describes.  It talks about discards, 
but this now changes the zero-write path.

I’m fairly certain that you are the only one using this option for now, 
so we might as well change its definition to include zero writes for 
8.2, but we should do that.

Hanna



  reply	other threads:[~2023-09-15 11:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-05 13:08 [PATCH v2] qcow2: keep reference on zeroize with discard-no-unref enabled Jean-Louis Dupond
2023-09-15 11:21 ` Hanna Czenczek [this message]
2023-09-25 11:40   ` Jean-Louis Dupond
2023-09-25 14:17     ` Hanna Czenczek
2023-10-03 12:53       ` Jean-Louis Dupond

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=1088caf4-3f59-84be-25d4-f2574674cb2a@redhat.com \
    --to=hreitz@redhat.com \
    --cc=jean-louis@dupond.be \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).