public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] generic/590: fix test failure when running against fs other than xfs
@ 2024-12-11 10:55 fdmanana
  2024-12-12  2:19 ` Dave Chinner
  2024-12-17  8:13 ` Christoph Hellwig
  0 siblings, 2 replies; 3+ messages in thread
From: fdmanana @ 2024-12-11 10:55 UTC (permalink / raw)
  To: fstests; +Cc: linux-btrfs, dchinner, Filipe Manana

From: Filipe Manana <fdmanana@suse.com>

With commit ce79de11337e ("fstests: clean up loop device instantiation")
we started to always call _destroy_loop_device at the very end of the
test, but we only create a loop device if we are running against xfs,
so the call to _destroy_loop_device results in an error since no loop
device was setup.

For example running this test against btrfs or ext4 results in this
failure:

   $ ./check generic/590
   FSTYP         -- btrfs
   PLATFORM      -- Linux/x86_64 debian0 6.13.0-rc1-btrfs-next-181+ #1 SMP PREEMPT_DYNAMIC Tue Dec  3 13:03:23 WET 2024
   MKFS_OPTIONS  -- /dev/sdc
   MOUNT_OPTIONS -- /dev/sdc /home/fdmanana/btrfs-tests/scratch_1

   generic/590 29s ... [failed, exit status 1]- output mismatch (see /home/fdmanana/git/hub/xfstests/results//generic/590.out.bad)
      --- tests/generic/590.out	2020-06-10 19:29:03.858520038 +0100
      +++ /home/fdmanana/git/hub/xfstests/results//generic/590.out.bad	2024-12-11 10:48:43.946205346 +0000
       @@ -1,2 +1,5 @@
       QA output created by 590
      -Silence is golden
      +losetup: option requires an argument -- 'd'
      +Try 'losetup --help' for more information.
      +Cannot destroy loop device
      +(see /home/fdmanana/git/hub/xfstests/results//generic/590.full for details)
      ...
      (Run 'diff -u /home/fdmanana/git/hub/xfstests/tests/generic/590.out /home/fdmanana/git/hub/xfstests/results//generic/590.out.bad'  to see the entire diff)
   Ran: generic/590
   Failures: generic/590
   Failed 1 of 1 tests

Fix this by removing the call to _destroy_loop_device at the end of the
test, as it's unnecessary because we call it in the _cleanup function if
we have setup a loop device.

Fixes: ce79de11337e ("fstests: clean up loop device instantiation")
Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
 tests/generic/590 | 2 --
 1 file changed, 2 deletions(-)

diff --git a/tests/generic/590 b/tests/generic/590
index 04d86e78..1adeef4c 100755
--- a/tests/generic/590
+++ b/tests/generic/590
@@ -115,8 +115,6 @@ $XFS_IO_PROG -c "truncate 0" -c fsync "$SCRATCH_MNT/file"
 # We need to do this before the loop device gets torn down.
 _scratch_unmount
 _check_scratch_fs
-_destroy_loop_device $loop_dev
-unset loop_dev
 
 echo "Silence is golden"
 status=0
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] generic/590: fix test failure when running against fs other than xfs
  2024-12-11 10:55 [PATCH] generic/590: fix test failure when running against fs other than xfs fdmanana
@ 2024-12-12  2:19 ` Dave Chinner
  2024-12-17  8:13 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: Dave Chinner @ 2024-12-12  2:19 UTC (permalink / raw)
  To: fdmanana; +Cc: fstests, linux-btrfs, dchinner, Filipe Manana

On Wed, Dec 11, 2024 at 10:55:25AM +0000, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
> 
> With commit ce79de11337e ("fstests: clean up loop device instantiation")
> we started to always call _destroy_loop_device at the very end of the
> test, but we only create a loop device if we are running against xfs,
> so the call to _destroy_loop_device results in an error since no loop
> device was setup.
> 
> For example running this test against btrfs or ext4 results in this
> failure:
> 
>    $ ./check generic/590
>    FSTYP         -- btrfs
>    PLATFORM      -- Linux/x86_64 debian0 6.13.0-rc1-btrfs-next-181+ #1 SMP PREEMPT_DYNAMIC Tue Dec  3 13:03:23 WET 2024
>    MKFS_OPTIONS  -- /dev/sdc
>    MOUNT_OPTIONS -- /dev/sdc /home/fdmanana/btrfs-tests/scratch_1
> 
>    generic/590 29s ... [failed, exit status 1]- output mismatch (see /home/fdmanana/git/hub/xfstests/results//generic/590.out.bad)
>       --- tests/generic/590.out	2020-06-10 19:29:03.858520038 +0100
>       +++ /home/fdmanana/git/hub/xfstests/results//generic/590.out.bad	2024-12-11 10:48:43.946205346 +0000
>        @@ -1,2 +1,5 @@
>        QA output created by 590
>       -Silence is golden
>       +losetup: option requires an argument -- 'd'
>       +Try 'losetup --help' for more information.
>       +Cannot destroy loop device
>       +(see /home/fdmanana/git/hub/xfstests/results//generic/590.full for details)
>       ...
>       (Run 'diff -u /home/fdmanana/git/hub/xfstests/tests/generic/590.out /home/fdmanana/git/hub/xfstests/results//generic/590.out.bad'  to see the entire diff)
>    Ran: generic/590
>    Failures: generic/590
>    Failed 1 of 1 tests
> 
> Fix this by removing the call to _destroy_loop_device at the end of the
> test, as it's unnecessary because we call it in the _cleanup function if
> we have setup a loop device.
> 
> Fixes: ce79de11337e ("fstests: clean up loop device instantiation")
> Signed-off-by: Filipe Manana <fdmanana@suse.com>
> ---
>  tests/generic/590 | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/tests/generic/590 b/tests/generic/590
> index 04d86e78..1adeef4c 100755
> --- a/tests/generic/590
> +++ b/tests/generic/590
> @@ -115,8 +115,6 @@ $XFS_IO_PROG -c "truncate 0" -c fsync "$SCRATCH_MNT/file"
>  # We need to do this before the loop device gets torn down.
>  _scratch_unmount
>  _check_scratch_fs
> -_destroy_loop_device $loop_dev
> -unset loop_dev
>  
>  echo "Silence is golden"
>  status=0
> -- 


Looks fine.

Reviewed-by: Dave Chinner <dchinner@redhat.com>
-- 
Dave Chinner
david@fromorbit.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] generic/590: fix test failure when running against fs other than xfs
  2024-12-11 10:55 [PATCH] generic/590: fix test failure when running against fs other than xfs fdmanana
  2024-12-12  2:19 ` Dave Chinner
@ 2024-12-17  8:13 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2024-12-17  8:13 UTC (permalink / raw)
  To: fdmanana; +Cc: fstests, linux-btrfs, dchinner, Filipe Manana

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-12-17  8:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-11 10:55 [PATCH] generic/590: fix test failure when running against fs other than xfs fdmanana
2024-12-12  2:19 ` Dave Chinner
2024-12-17  8:13 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox