diff mbox series

[7/7] xfs/020: call _notrun if we can't create a 60t sparse image

Message ID 157915147960.2374854.2067220014390694914.stgit@magnolia (mailing list archive)
State Accepted
Headers show
Series fstests: random fixes | expand

Commit Message

Darrick J. Wong Jan. 16, 2020, 5:11 a.m. UTC
From: Darrick J. Wong <darrick.wong@oracle.com>

If we can't create the 60T sparse image for testing repair on a large fs
(such as when running on 32-bit), don't bother running the rest of the
test.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 tests/xfs/020 |    2 ++
 1 file changed, 2 insertions(+)

Comments

Christoph Hellwig Jan. 16, 2020, 9:25 a.m. UTC | #1
On Wed, Jan 15, 2020 at 09:11:19PM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> If we can't create the 60T sparse image for testing repair on a large fs
> (such as when running on 32-bit), don't bother running the rest of the
> test.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>
Darrick J. Wong Feb. 2, 2020, 7:54 p.m. UTC | #2
On Wed, Jan 15, 2020 at 09:11:19PM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> If we can't create the 60T sparse image for testing repair on a large fs
> (such as when running on 32-bit), don't bother running the rest of the
> test.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
>  tests/xfs/020 |    2 ++
>  1 file changed, 2 insertions(+)
> 
> 
> diff --git a/tests/xfs/020 b/tests/xfs/020
> index 61da4101..e39c3482 100755
> --- a/tests/xfs/020
> +++ b/tests/xfs/020
> @@ -42,6 +42,8 @@ echo "Silence is golden"
>  
>  fsfile=$TEST_DIR/fsfile.$seq
>  rm -f $fsfile
> +truncate -s 60t $fsfile || _notrun "Cannot create 60T sparse file for test."

Um, this got committed with "xfs_io -x -c 'truncate 60t' and not as
written, which means that this test does not work on i386 because xfs_io
doesn't return nonzero when the truncate syscall fails.  Will send
patch.

--D

> +rm -f $fsfile
>  
>  $MKFS_PROG -t xfs -d size=60t,file,name=$fsfile >/dev/null
>  $XFS_REPAIR_PROG -f -o ag_stride=32 -t 1 $fsfile >/dev/null 2>&1
>
diff mbox series

Patch

diff --git a/tests/xfs/020 b/tests/xfs/020
index 61da4101..e39c3482 100755
--- a/tests/xfs/020
+++ b/tests/xfs/020
@@ -42,6 +42,8 @@  echo "Silence is golden"
 
 fsfile=$TEST_DIR/fsfile.$seq
 rm -f $fsfile
+truncate -s 60t $fsfile || _notrun "Cannot create 60T sparse file for test."
+rm -f $fsfile
 
 $MKFS_PROG -t xfs -d size=60t,file,name=$fsfile >/dev/null
 $XFS_REPAIR_PROG -f -o ag_stride=32 -t 1 $fsfile >/dev/null 2>&1