qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: vsementsov@virtuozzo.com, berto@igalia.com,
	qemu-devel@nongnu.org, qemu-block@nongnu.org, mreitz@redhat.com
Subject: Re: [PATCH v5 4/9] qcow2: Support BDRV_REQ_ZERO_WRITE for truncate
Date: Thu, 23 Apr 2020 08:59:12 -0500	[thread overview]
Message-ID: <be3189fa-8120-9bae-166d-f95f5d3a94c7@redhat.com> (raw)
In-Reply-To: <20200423132302.GA23654@linux.fritz.box>

On 4/23/20 8:23 AM, Kevin Wolf wrote:

>>>
>>> So qcow2_cluster_zeroize() seems to accept the unaligned tail. It would
>>> still set the zero flag for the partial last cluster and for the
>>> external data file, bdrv_co_pwrite_zeroes() would have the correct size.
>>
>> Then I'm in favor of NOT rounding the tail.  That's an easy enough change
>> and we've now justified that it does what we want, so R-b stands with that
>> one-line tweak.
> 
> Would have been too easy... bs->total_sectors isn't updated yet, so the
> assertion does fail.
> 
> I can make the assertion check end_offset >= ... instead. That should
> still check what we wanted to check here and allow the unaligned
> extension.

Yes, that works for me.

> 
> This feels like the better option to me compared to updating
> bs->total_sectors earlier and then undoing that change in every error
> path.

Indeed.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org



  reply	other threads:[~2020-04-23 14:00 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-22 15:21 [PATCH v5 0/9] block: Fix resize (extending) of short overlays Kevin Wolf
2020-04-22 15:21 ` [PATCH v5 1/9] block: Add flags to BlockDriver.bdrv_co_truncate() Kevin Wolf
2020-04-23  9:41   ` Max Reitz
2020-04-23 12:42     ` Kevin Wolf
2020-04-22 15:21 ` [PATCH v5 2/9] block: Add flags to bdrv(_co)_truncate() Kevin Wolf
2020-04-23 10:04   ` Max Reitz
2020-04-22 15:21 ` [PATCH v5 3/9] block-backend: Add flags to blk_truncate() Kevin Wolf
2020-04-23 10:34   ` Max Reitz
2020-04-22 15:21 ` [PATCH v5 4/9] qcow2: Support BDRV_REQ_ZERO_WRITE for truncate Kevin Wolf
2020-04-22 15:33   ` Eric Blake
2020-04-22 15:58     ` Kevin Wolf
2020-04-22 16:14       ` Eric Blake
2020-04-23 13:23         ` Kevin Wolf
2020-04-23 13:59           ` Eric Blake [this message]
2020-04-23 10:53   ` Max Reitz
2020-04-23 13:25     ` Kevin Wolf
2020-04-23 13:56       ` Max Reitz
2020-04-22 15:21 ` [PATCH v5 5/9] raw-format: " Kevin Wolf
2020-04-22 15:34   ` Eric Blake
2020-04-23 10:54   ` Max Reitz
2020-04-22 15:21 ` [PATCH v5 6/9] file-posix: " Kevin Wolf
2020-04-23 10:57   ` Max Reitz
2020-04-22 15:21 ` [PATCH v5 7/9] block: truncate: Don't make backing file data visible Kevin Wolf
2020-04-23 11:14   ` Max Reitz
2020-04-23 13:00     ` Kevin Wolf
2020-04-22 15:21 ` [PATCH v5 8/9] iotests: Filter testfiles out in filter_img_info() Kevin Wolf
2020-04-23 11:24   ` Max Reitz
2020-04-22 15:21 ` [PATCH v5 9/9] iotests: Test committing to short backing file Kevin Wolf
2020-04-23 11:53   ` Max Reitz

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=be3189fa-8120-9bae-166d-f95f5d3a94c7@redhat.com \
    --to=eblake@redhat.com \
    --cc=berto@igalia.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@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 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).