public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] generic/574: don't fail the test on intentional coredump
@ 2024-03-12 14:57 Darrick J. Wong
  2024-03-12 15:30 ` Bill O'Donnell
  2024-03-12 16:43 ` Eric Biggers
  0 siblings, 2 replies; 3+ messages in thread
From: Darrick J. Wong @ 2024-03-12 14:57 UTC (permalink / raw)
  To: Eric Biggers; +Cc: fstests, xfs, aalbersh, Zorro Lang

From: Darrick J. Wong <djwong@kernel.org>

Don't fail this test just because the mmap read of a corrupt verity file
causes xfs_io to segfault and then dump core.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 tests/generic/574 |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/generic/574 b/tests/generic/574
index 067b3033a8..cb42baaa67 100755
--- a/tests/generic/574
+++ b/tests/generic/574
@@ -74,7 +74,8 @@ mread()
 	# shell instance from optimizing out the fork and directly exec'ing
 	# xfs_io.  The easiest way to do that is to append 'true' to the
 	# commands, so that xfs_io is no longer the last command the shell sees.
-	bash -c "trap '' SIGBUS; $XFS_IO_PROG -r $file \
+	# Don't let it write core files to the filesystem.
+	bash -c "trap '' SIGBUS; ulimit -c 0; $XFS_IO_PROG -r $file \
 		-c 'mmap -r 0 $map_len' \
 		-c 'mread -v $offset $length'; true"
 }

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

* Re: [PATCH] generic/574: don't fail the test on intentional coredump
  2024-03-12 14:57 [PATCH] generic/574: don't fail the test on intentional coredump Darrick J. Wong
@ 2024-03-12 15:30 ` Bill O'Donnell
  2024-03-12 16:43 ` Eric Biggers
  1 sibling, 0 replies; 3+ messages in thread
From: Bill O'Donnell @ 2024-03-12 15:30 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Eric Biggers, fstests, xfs, aalbersh, Zorro Lang

On Tue, Mar 12, 2024 at 07:57:20AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> Don't fail this test just because the mmap read of a corrupt verity file
> causes xfs_io to segfault and then dump core.
> 
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>

Looks fine.
Reviewed-by: Bill O'Donnell <bodonnel@redhat.com>

> ---
>  tests/generic/574 |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/generic/574 b/tests/generic/574
> index 067b3033a8..cb42baaa67 100755
> --- a/tests/generic/574
> +++ b/tests/generic/574
> @@ -74,7 +74,8 @@ mread()
>  	# shell instance from optimizing out the fork and directly exec'ing
>  	# xfs_io.  The easiest way to do that is to append 'true' to the
>  	# commands, so that xfs_io is no longer the last command the shell sees.
> -	bash -c "trap '' SIGBUS; $XFS_IO_PROG -r $file \
> +	# Don't let it write core files to the filesystem.
> +	bash -c "trap '' SIGBUS; ulimit -c 0; $XFS_IO_PROG -r $file \
>  		-c 'mmap -r 0 $map_len' \
>  		-c 'mread -v $offset $length'; true"
>  }
> 


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

* Re: [PATCH] generic/574: don't fail the test on intentional coredump
  2024-03-12 14:57 [PATCH] generic/574: don't fail the test on intentional coredump Darrick J. Wong
  2024-03-12 15:30 ` Bill O'Donnell
@ 2024-03-12 16:43 ` Eric Biggers
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Biggers @ 2024-03-12 16:43 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: fstests, xfs, aalbersh, Zorro Lang

On Tue, Mar 12, 2024 at 07:57:20AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> Don't fail this test just because the mmap read of a corrupt verity file
> causes xfs_io to segfault and then dump core.
> 
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---
>  tests/generic/574 |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/generic/574 b/tests/generic/574
> index 067b3033a8..cb42baaa67 100755
> --- a/tests/generic/574
> +++ b/tests/generic/574
> @@ -74,7 +74,8 @@ mread()
>  	# shell instance from optimizing out the fork and directly exec'ing
>  	# xfs_io.  The easiest way to do that is to append 'true' to the
>  	# commands, so that xfs_io is no longer the last command the shell sees.
> -	bash -c "trap '' SIGBUS; $XFS_IO_PROG -r $file \
> +	# Don't let it write core files to the filesystem.
> +	bash -c "trap '' SIGBUS; ulimit -c 0; $XFS_IO_PROG -r $file \
>  		-c 'mmap -r 0 $map_len' \
>  		-c 'mread -v $offset $length'; true"
>  }

Reviewed-by: Eric Biggers <ebiggers@google.com>

- Eric

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

end of thread, other threads:[~2024-03-12 16:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-12 14:57 [PATCH] generic/574: don't fail the test on intentional coredump Darrick J. Wong
2024-03-12 15:30 ` Bill O'Donnell
2024-03-12 16:43 ` Eric Biggers

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