[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v6 10/10] qcow2: Forward ZERO_WRITE flag for full preallocati
From: |
Max Reitz |
Subject: |
Re: [PATCH v6 10/10] qcow2: Forward ZERO_WRITE flag for full preallocation |
Date: |
Thu, 23 Apr 2020 20:05:38 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 |
On 23.04.20 17:01, Kevin Wolf wrote:
> The BDRV_REQ_ZERO_WRITE is currently implemented in a way that first the
> image is possibly preallocated and then the zero flag is added to all
> clusters. This means that a copy-on-write operation may be needed when
> writing to these clusters, despite having used preallocation, negating
> one of the major benefits of preallocation.
>
> Instead, try to forward the BDRV_REQ_ZERO_WRITE to the protocol driver,
> and if the protocol driver can ensure that the new area reads as zeros,
> we can skip setting the zero flag in the qcow2 layer.
>
> Unfortunately, the same approach doesn't work for metadata
> preallocation, so we'll still set the zero flag there.
>
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
> block/qcow2.c | 22 +++++++++++++++++++---
> tests/qemu-iotests/274.out | 4 ++--
> 2 files changed, 21 insertions(+), 5 deletions(-)
Oh, nice. I didn’t think you (or anyone else for that matter) would
actually do this. :)
With the errp thing fixed:
Reviewed-by: Max Reitz <address@hidden>
signature.asc
Description: OpenPGP digital signature
- Re: [PATCH v6 07/10] block: truncate: Don't make backing file data visible, (continued)