[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 7/8] block: Pass truncate exact=true where reasonable
From: |
Max Reitz |
Subject: |
Re: [PATCH 7/8] block: Pass truncate exact=true where reasonable |
Date: |
Mon, 28 Oct 2019 12:08:30 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 |
On 18.09.19 22:52, Maxim Levitsky wrote:
> On Wed, 2019-09-18 at 11:51 +0200, Max Reitz wrote:
>> This is a change in behavior, so all instances need a good
>> justification. The comments added here should explain my reasoning.
>>
>> qed already had a comment that suggests it always expected
>> bdrv_truncate()/blk_truncate() to behave as if exact=true were passed
>> (c743849bee7 came eight months before 55b949c8476), so it was simply
>> broken until now.
>>
>> Signed-off-by: Max Reitz <address@hidden>
>> ---
>> block/parallels.c | 11 +++++++++--
>> block/qcow2.c | 6 +++++-
>> block/qed.c | 2 +-
>> qemu-img.c | 7 ++++++-
>> qemu-io-cmds.c | 7 ++++++-
>> 5 files changed, 27 insertions(+), 6 deletions(-)
[...]
>> diff --git a/block/qed.c b/block/qed.c
>> index 7c2a65af40..8005cfc305 100644
>> --- a/block/qed.c
>> +++ b/block/qed.c
>> @@ -674,7 +674,7 @@ static int coroutine_fn
>> bdrv_qed_co_create(BlockdevCreateOptions *opts,
>> l1_size = header.cluster_size * header.table_size;
>>
>> /* File must start empty and grow, check truncate is supported */
> I would update the above comment, with something like
>
> "QED format requires the underlying file to have the exact expected length,
> which is 0 on creation"
> Or something similar.
I’ll change it to:
The QED format associates file length with allocation status,
so a new file (which is empty) must have a length of 0.
Hope that’s OK. :-)
Max
signature.asc
Description: OpenPGP digital signature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PATCH 7/8] block: Pass truncate exact=true where reasonable,
Max Reitz <=