diff mbox series

generic/604: fix test to actually create dirty inodes

Message ID 4dd1c7d583289c12d2acf8bfee3b555307399220.1676564465.git.fdmanana@suse.com (mailing list archive)
State New, archived
Headers show
Series generic/604: fix test to actually create dirty inodes | expand

Commit Message

Filipe Manana Feb. 16, 2023, 4:21 p.m. UTC
From: Filipe Manana <fdmanana@suse.com>

The test case generic/604 aims to test a scenario where at unmount time we
have many dirty inodes, however the test does not actually creates any
files, because it calls xfs_io without the -f argument, so xfs_io fails
but any error is ignored because stderr is redirected to /dev/null.

Fix this by passing -f to xfs_io and also stop redirecting stderr to
/dev/null, so that in case of any unexpected failure creating files, the
test fails.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
 tests/generic/604 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Bill O'Donnell Feb. 16, 2023, 5:55 p.m. UTC | #1
On Thu, Feb 16, 2023 at 04:21:50PM +0000, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
> 
> The test case generic/604 aims to test a scenario where at unmount time we
> have many dirty inodes, however the test does not actually creates any
> files, because it calls xfs_io without the -f argument, so xfs_io fails
> but any error is ignored because stderr is redirected to /dev/null.
> 
> Fix this by passing -f to xfs_io and also stop redirecting stderr to
> /dev/null, so that in case of any unexpected failure creating files, the
> test fails.
> 
> Signed-off-by: Filipe Manana <fdmanana@suse.com>
lgtm...
Reviewed-by: Bill O'Donnell <bodonnel@redhat.com>

> ---
>  tests/generic/604 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/generic/604 b/tests/generic/604
> index 3c6b76a4..9c53fd57 100755
> --- a/tests/generic/604
> +++ b/tests/generic/604
> @@ -22,7 +22,7 @@ _require_scratch
>  _scratch_mkfs > /dev/null 2>&1
>  _scratch_mount
>  for i in $(seq 0 500); do
> -	$XFS_IO_PROG -c "pwrite 0 4K" $SCRATCH_MNT/$i >/dev/null 2>&1
> +	$XFS_IO_PROG -f -c "pwrite 0 4K" $SCRATCH_MNT/$i >/dev/null
>  done
>  _scratch_unmount &
>  _scratch_mount
> -- 
> 2.35.1
>
Zorro Lang Feb. 17, 2023, 8:15 a.m. UTC | #2
On Thu, Feb 16, 2023 at 04:21:50PM +0000, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
> 
> The test case generic/604 aims to test a scenario where at unmount time we
> have many dirty inodes, however the test does not actually creates any
> files, because it calls xfs_io without the -f argument, so xfs_io fails
> but any error is ignored because stderr is redirected to /dev/null.
> 
> Fix this by passing -f to xfs_io and also stop redirecting stderr to
> /dev/null, so that in case of any unexpected failure creating files, the
> test fails.
> 
> Signed-off-by: Filipe Manana <fdmanana@suse.com>
> ---
>  tests/generic/604 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/generic/604 b/tests/generic/604
> index 3c6b76a4..9c53fd57 100755
> --- a/tests/generic/604
> +++ b/tests/generic/604
> @@ -22,7 +22,7 @@ _require_scratch
>  _scratch_mkfs > /dev/null 2>&1
>  _scratch_mount
>  for i in $(seq 0 500); do
> -	$XFS_IO_PROG -c "pwrite 0 4K" $SCRATCH_MNT/$i >/dev/null 2>&1
> +	$XFS_IO_PROG -f -c "pwrite 0 4K" $SCRATCH_MNT/$i >/dev/null

Thanks for catching and fixing this issue.

Reviewed-by: Zorro Lang <zlang@redhat.com>

>  done
>  _scratch_unmount &
>  _scratch_mount
> -- 
> 2.35.1
>
diff mbox series

Patch

diff --git a/tests/generic/604 b/tests/generic/604
index 3c6b76a4..9c53fd57 100755
--- a/tests/generic/604
+++ b/tests/generic/604
@@ -22,7 +22,7 @@  _require_scratch
 _scratch_mkfs > /dev/null 2>&1
 _scratch_mount
 for i in $(seq 0 500); do
-	$XFS_IO_PROG -c "pwrite 0 4K" $SCRATCH_MNT/$i >/dev/null 2>&1
+	$XFS_IO_PROG -f -c "pwrite 0 4K" $SCRATCH_MNT/$i >/dev/null
 done
 _scratch_unmount &
 _scratch_mount