qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Alberto Garcia <berto@igalia.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
	qemu-block@nongnu.org, Max Reitz <mreitz@redhat.com>
Subject: Re: [PATCH v2] qcow2: Fix preallocation on images with unaligned sizes
Date: Wed, 17 Jun 2020 10:14:21 -0500	[thread overview]
Message-ID: <b9138a23-96c6-ef71-f75a-ff302fda4570@redhat.com> (raw)
In-Reply-To: <20200617140036.20311-1-berto@igalia.com>

On 6/17/20 9:00 AM, Alberto Garcia wrote:
> When resizing an image with qcow2_co_truncate() using the falloc or
> full preallocation modes the code assumes that both the old and new
> sizes are cluster-aligned.
> 
> There are two problems with this:
> 
>    1) The calculation of how many clusters are involved does not always
>       get the right result.
> 
>       Example: creating a 60KB image and resizing it (with
>       preallocation=full) to 80KB won't allocate the second cluster.
> 
>    2) No copy-on-write is performed, so in the previous example if
>       there is a backing file then the first 60KB of the first cluster
>       won't be filled with data from the backing file.
> 
> This patch fixes both issues.
> 
> Signed-off-by: Alberto Garcia <berto@igalia.com>
> ---
> v2: iotests: don't check the image size if data_file is set [Max]
> 

Reviewed-by: Eric Blake <eblake@redhat.com>

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



  parent reply	other threads:[~2020-06-17 15:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-17 14:00 [PATCH v2] qcow2: Fix preallocation on images with unaligned sizes Alberto Garcia
2020-06-17 14:27 ` no-reply
2020-06-17 15:14 ` Eric Blake [this message]
2020-06-23 14:14 ` Alberto Garcia
2020-06-30  9:37 ` 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=b9138a23-96c6-ef71-f75a-ff302fda4570@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 \
    /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).