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

Reply via email to