[PATCH 0/3] iotests: Fix 125

Max Reitz posted 3 patches 4 years, 7 months ago
Test docker-mingw@fedora passed
Test checkpatch passed
Test docker-clang@ubuntu passed
Test docker-quick@centos7 passed
Test FreeBSD passed
Test asan passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20190925183231.11196-1-mreitz@redhat.com
Maintainers: Kevin Wolf <kwolf@redhat.com>, Max Reitz <mreitz@redhat.com>
tests/qemu-iotests/125 | 45 +++++++++++++++++++++++++++++++++++++++---
1 file changed, 42 insertions(+), 3 deletions(-)
[PATCH 0/3] iotests: Fix 125
Posted by Max Reitz 4 years, 7 months ago
Hi,

iotest 125 is very broken.  It uses qemu-img info’s “disk size” to
determine an image’s on-disk size, but it does so in a wrong way: It
just fetches the first number ([0-9]+), but that isn’t very useful
because qemu-img info emits human-readable values that include units and
decimal points.

We should ust stat -c %b instead.  That’s done in patch 3.
Unfortunately, doing so exposed more problems.

Patch 1 fixes a stupid bug in the test itself that we never noticed
because of what patch 3 fixes.  (Pull patch 3 before patch 1 and you’ll
see.)

The other thing is actually a bug in XFS.  Its fallocate()
implementation rounds up the length independently of the offset, so if
you try to fallocate an unaligned range, chances are that it might not
allocate the last block your range touches.  Patch 2 detects that case
and skips the test then.  (Pull patch 3 before patch 2 and you’ll see
the test fail on XFS.)


Max Reitz (3):
  iotests: Fix 125 for growth_mode = metadata
  iotests: Disable 125 on broken XFS versions
  iotests: Use stat -c %b in 125

 tests/qemu-iotests/125 | 45 +++++++++++++++++++++++++++++++++++++++---
 1 file changed, 42 insertions(+), 3 deletions(-)

-- 
2.21.0


Re: [PATCH 0/3] iotests: Fix 125
Posted by Max Reitz 4 years, 6 months ago
On 25.09.19 20:32, Max Reitz wrote:
> Hi,
> 
> iotest 125 is very broken.  It uses qemu-img info’s “disk size” to
> determine an image’s on-disk size, but it does so in a wrong way: It
> just fetches the first number ([0-9]+), but that isn’t very useful
> because qemu-img info emits human-readable values that include units and
> decimal points.
> 
> We should ust stat -c %b instead.  That’s done in patch 3.
> Unfortunately, doing so exposed more problems.
> 
> Patch 1 fixes a stupid bug in the test itself that we never noticed
> because of what patch 3 fixes.  (Pull patch 3 before patch 1 and you’ll
> see.)
> 
> The other thing is actually a bug in XFS.  Its fallocate()
> implementation rounds up the length independently of the offset, so if
> you try to fallocate an unaligned range, chances are that it might not
> allocate the last block your range touches.  Patch 2 detects that case
> and skips the test then.  (Pull patch 3 before patch 2 and you’ll see
> the test fail on XFS.)
> 
> 
> Max Reitz (3):
>   iotests: Fix 125 for growth_mode = metadata
>   iotests: Disable 125 on broken XFS versions
>   iotests: Use stat -c %b in 125
> 
>  tests/qemu-iotests/125 | 45 +++++++++++++++++++++++++++++++++++++++---
>  1 file changed, 42 insertions(+), 3 deletions(-)

Thanks for the review, applied to my block branch:

https://git.xanclic.moe/XanClic/qemu/commits/branch/block


And for the record, I’ve sent a patch to the XFS driver:

https://www.spinics.net/lists/linux-xfs/msg32174.html

Max