[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 02/30] qcow2: Convert qcow2_get_cluster_offset() into qcow
From: |
Alberto Garcia |
Subject: |
Re: [PATCH v4 02/30] qcow2: Convert qcow2_get_cluster_offset() into qcow2_get_host_offset() |
Date: |
Wed, 08 Apr 2020 19:29:07 +0200 |
User-agent: |
Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) |
On Wed 08 Apr 2020 12:51:24 PM CEST, Max Reitz wrote:
>> - if (has_data_file(bs) && *cluster_offset != offset -
>> offset_in_cluster)
>> + if (has_data_file(bs) && *host_offset != offset - offset_in_cluster)
>> {
>
> (1) The { should be moved to the preceding line;
>
> (2) I think it makes more sense to move the
> “*host_offset += offset_in_cluster” before this condition, so it becomes
> “... && *host_offset != offset”.
>
>> qcow2_signal_corruption(bs, true, -1, -1,
>> "External data file host cluster offset
>> %#"
>
> (Maybe we then need to drop the “cluster” from this line, but other than
> that, it would fit with this error message.)
The reason why I have “*host_offset += offset_in_cluster” after the
condition is precisely to keep the cluster-aligned offset in the error
message. But of course I could also use start_of_cluster() or similar in
the error message.
Berto