[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH for-2.8 v2] qcow2: Don't strand clusters near 2G
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-block] [PATCH for-2.8 v2] qcow2: Don't strand clusters near 2G intervals during commit |
Date: |
Tue, 6 Dec 2016 09:47:33 +0000 |
User-agent: |
Mutt/1.7.1 (2016-10-04) |
On Mon, Dec 05, 2016 at 09:49:34AM -0600, Eric Blake wrote:
> The qcow2_make_empty() function is reached during 'qemu-img commit',
> in order to clear out ALL clusters of an image. However, if the
> image cannot use the fast code path (true if the image is format
> 0.10, or if the image contains a snapshot), the cluster size is
> larger than 512, and the image is larger than 2G in size, then our
> choice of sector_step causes problems. Since it is not cluster
> aligned, but qcow2_discard_clusters() silently ignores an unaligned
> head or tail, we are leaving clusters allocated.
>
> Enhance the testsuite to expose the flaw, and patch the problem by
> ensuring our step size is aligned.
>
> Signed-off-by: Eric Blake <address@hidden>
>
> ---
> v2: perform rounding correctly
> ---
> block/qcow2.c | 3 +-
> tests/qemu-iotests/097 | 41 +++++---
> tests/qemu-iotests/097.out | 249
> +++++++++++++++++++++++++++++++++------------
> 3 files changed, 210 insertions(+), 83 deletions(-)
Reviewed-by: Stefan Hajnoczi <address@hidden>
signature.asc
Description: PGP signature