[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v9 28/34] qcow2: Add subcluster support to qcow2_co_pwrite_ze
From: |
Alberto Garcia |
Subject: |
Re: [PATCH v9 28/34] qcow2: Add subcluster support to qcow2_co_pwrite_zeroes() |
Date: |
Fri, 03 Jul 2020 00:40:19 +0200 |
User-agent: |
Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) |
On Thu 02 Jul 2020 04:28:57 PM CEST, Max Reitz wrote:
>> + /* For full clusters use zero_in_l2_slice() instead */
>> + assert(nb_subclusters > 0 && nb_subclusters <
>> s->subclusters_per_cluster);
>> + assert(sc + nb_subclusters <= s->subclusters_per_cluster);
>
> Maybe we should also assert that @offset is aligned to the subcluster
> size.
It doesn't hurt but the only caller already guarantees that already ...
>> @@ -4367,12 +4367,13 @@ static int coroutine_fn
>> qcow2_co_truncate(BlockDriverState *bs, int64_t offset,
>> uint64_t zero_start = QEMU_ALIGN_UP(old_length, s->cluster_size);
>
> Can we instead align this to just subclusters?
I think so, good catch.
Berto