From: Max Reitz <mreitz@redhat.com>
To: Alberto Garcia <berto@igalia.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, qemu-block@nongnu.org
Subject: Re: [PATCH v2] qcow2: Fix preallocation on images with unaligned sizes
Date: Tue, 30 Jun 2020 11:37:13 +0200 [thread overview]
Message-ID: <2171ec86-bc54-813d-c343-8320f9cbbd47@redhat.com> (raw)
In-Reply-To: <20200617140036.20311-1-berto@igalia.com>
[-- Attachment #1.1: Type: text/plain, Size: 1192 bytes --]
On 17.06.20 16:00, 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]
>
> block/qcow2.c | 17 ++++++++++++++---
> tests/qemu-iotests/125 | 24 ++++++++++++++++++++++++
> tests/qemu-iotests/125.out | 9 +++++++++
> 3 files changed, 47 insertions(+), 3 deletions(-)
Thanks, applied to my block branch:
https://git.xanclic.moe/XanClic/qemu/commits/branch/block
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
prev parent reply other threads:[~2020-06-30 9:38 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
2020-06-23 14:14 ` Alberto Garcia
2020-06-30 9:37 ` Max Reitz [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=2171ec86-bc54-813d-c343-8320f9cbbd47@redhat.com \
--to=mreitz@redhat.com \
--cc=berto@igalia.com \
--cc=kwolf@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).