xfs/020: call _notrun if we can't create a 60t sparse image
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 16 Jan 2020 05:11:19 +0000 (21:11 -0800)
committerEryu Guan <guaneryu@gmail.com>
Sun, 2 Feb 2020 13:17:29 +0000 (21:17 +0800)
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.

[Eryu: use xfs_io instead of truncate]

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/xfs/020

index 61da41017d3cbae2905278146fc30d28d825ae49..66433b0a52c154c5d1f1171f7c269e0934ede1da 100755 (executable)
@@ -42,6 +42,8 @@ echo "Silence is golden"
 
 fsfile=$TEST_DIR/fsfile.$seq
 rm -f $fsfile
+$XFS_IO_PROG -f -c "truncate 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