On 25.09.19 23:28, Eric Blake wrote:
> On 9/25/19 1:32 PM, Max Reitz wrote:
>> And by that I mean all XFS versions, as far as I can tell.  All details
>> are in the comment below.
>>
>> We never noticed this problem because we only read the first number from
>> qemu-img info's "disk size" output -- and that is effectively useless,
>> because qemu-img prints a human-readable value (which generally includes
>> a decimal point).  That will be fixed in the next patch.
>>
>> Signed-off-by: Max Reitz <mre...@redhat.com>
>> ---
>>   tests/qemu-iotests/125 | 40 ++++++++++++++++++++++++++++++++++++++++
>>   1 file changed, 40 insertions(+)
>>
>> diff --git a/tests/qemu-iotests/125 b/tests/qemu-iotests/125
>> index df328a63a6..0ef51f1e21 100755
>> --- a/tests/qemu-iotests/125
>> +++ b/tests/qemu-iotests/125
>> @@ -49,6 +49,46 @@ if [ -z "$TEST_IMG_FILE" ]; then
>>       TEST_IMG_FILE=$TEST_IMG
>>   fi
>>   +# Test whether we are running on a broken XFS version.  There is this
>> +# bug:
>> +
>> +# $ rm -f foo
>> +# $ touch foo
>> +# $ block_size=4096 # Your FS's block size
>> +# $ fallocate -o $((block_size / 2)) -l $block_size foo
>> +# $ LANG=C xfs_bmap foo | grep hole
>> +#         1: [8..15]: hole
>> +#
>> +# The problem is that the XFS driver rounds down the offset and
>> +# rounds up the length to the block size, but independently.
> 
> Eww. I concur you uncovered a bug.  Have you reported this to xfs folks?

I have now.  Took a bit of kernel compiling to see whether what I think
would fix it works.

Max

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to