RFC: don't fail tests when mkfs options collide
Hi all,
I've been running some tests with forced large log sizes, and forced sector sizes, and get a fair amount of failures because these options collide with options forced by the tests themselves. The series here was my attempt to fix this by not failing the tests in this case but _notrun them and print the options that caused them to fail.
While writing up this cover letter I realized that the scratch fs options are much deeper mess than that, so this approach might not be what we actually want, but I though to send it out for comments anyway.
So what could we do instead? We might distinguish better between tests that just want to create a scratch file system with $MKFS_OPTIONS from the xfstests config, and those (file system specific ones) that want to force very specific file system configurations. How do we get there?
A first step might be to split up _scratch_mkfs into a plain _scratch_mkfs that never takes any options, and a _scratch_mkfs_opts that takes options. The former should never fail as that would be a grave error rendering all $SCRATCH_DEV based tests useless. The latter can and should _notrun when the options conflict, or they might be able to do some limited filtering to reduce the amount of conflict, but I suspect that is kinda futile.
Last but not least we should probably kill the separate _scratch_mkfs_xfs (and _scratch_mkfs_ext4) which is used rather inconsistently.
PATCH 1/4 common: _notrun if _scratch_mkfs_sized failed
If we fail to create a file system of a specific size that means it can't work with some of the options in $MKFS_OPTIONS like the log size. Don't fail the test case for that, but instead _norun it and display the options that caused it to fail.
--- common/rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
common/rc +1 -1
@@ -1168,7 +1168,7 @@ _try_scratch_mkfs_sized() _scratch_mkfs_sized() { - _try_scratch_mkfs_sized $* || _fail "_scratch_mkfs_sized failed with ($*)" + _try_scratch_mkfs_sized $* || _notrun "_scratch_mkfs_sized failed with ($*)" } # Emulate an N-data-disk stripe w/ various stripe units
Signature · 1 line
2.43.0
PATCH 2/4 common: _notrun if _scratch_mkfs_xfs failed
In reply to Christoph HellwigIf we fail to create a file system with specific passed in options, that that these options conflict with other options $MKFS_OPTIONS. Don't fail the test case for that, but instead _norun it and display the options that caused it to fail.
Add a lower-level _try_scratch_mkfs_xfs helper for those places that want to check the return value.
--- common/attr | 4 ++-- common/filestreams | 2 +- common/log | 4 ++-- common/rc | 9 +++++---- common/xfs | 28 +++++++++++++++++----------- tests/generic/083 | 3 +-- tests/xfs/002 | 2 +- tests/xfs/004 | 2 +- tests/xfs/005 | 2 +- tests/xfs/009 | 2 +- tests/xfs/017 | 3 +-- tests/xfs/019 | 3 +-- tests/xfs/021 | 3 +-- tests/xfs/022 | 2 +- tests/xfs/023 | 2 +- tests/xfs/024 | 2 +- tests/xfs/025 | 2 +- tests/xfs/026 | 2 +- tests/xfs/027 | 2 +- tests/xfs/028 | 2 +- tests/xfs/030 | 2 +- tests/xfs/034 | 3 +-- tests/xfs/035 | 2 +- tests/xfs/036 | 2 +- tests/xfs/037 | 2 +- tests/xfs/038 | 2 +- tests/xfs/039 | 2 +- tests/xfs/041 | 2 +- tests/xfs/042 | 2 +- tests/xfs/043 | 2 +- tests/xfs/044 | 2 +- tests/xfs/045 | 2 +- tests/xfs/046 | 2 +- tests/xfs/047 | 2 +- tests/xfs/055 | 2 +- tests/xfs/056 | 2 +- tests/xfs/059 | 2 +- tests/xfs/060 | 2 +- tests/xfs/061 | 2 +- tests/xfs/063 | 2 +- tests/xfs/064 | 2 +- tests/xfs/066 | 2 +- tests/xfs/068 | 2 +- tests/xfs/070 | 1 - tests/xfs/072 | 2 +- tests/xfs/077 | 2 +- tests/xfs/090 | 2 +- tests/xfs/094 | 2 +- tests/xfs/103 | 2 +- tests/xfs/121 | 3 +-- tests/xfs/153 | 2 +- tests/xfs/168 | 4 ++-- tests/xfs/178 | 6 ++---- tests/xfs/181 | 3 +-- tests/xfs/183 | 3 +-- tests/xfs/202 | 3 +-- tests/xfs/244 | 4 ++-- tests/xfs/266 | 2 +- tests/xfs/267 | 2 +- tests/xfs/268 | 2 +- tests/xfs/281 | 2 +- tests/xfs/282 | 2 +- tests/xfs/283 | 2 +- tests/xfs/287 | 3 +-- tests/xfs/296 | 2 +- tests/xfs/300 | 3 +-- tests/xfs/301 | 2 +- tests/xfs/302 | 2 +- tests/xfs/306 | 3 +-- tests/xfs/445 | 3 +-- tests/xfs/448 | 1 - tests/xfs/520 | 2 +- tests/xfs/596 | 1 - 73 files changed, 95 insertions(+), 106 deletions(-)
common/attr +2 -2
@@ -237,8 +237,8 @@ _require_attr_v1() # check if we support the noattr2 mount option _require_noattr2() { - _scratch_mkfs_xfs > /dev/null 2>&1 \ - || _fail "_scratch_mkfs_xfs failed on $SCRATCH_DEV" + _try_scratch_mkfs_xfs > /dev/null 2>&1 \ + || _fail "_try_scratch_mkfs_xfs failed on $SCRATCH_DEV" _try_scratch_mount -o noattr2 > /dev/null 2>&1 \ || _notrun "noattr2 mount option not supported on $SCRATCH_DEV" _scratch_unmount
common/filestreams +1 -1
@@ -96,7 +96,7 @@ _test_streams() { unset SCRATCH_RTDEV local size=`expr $agsize \* 1024 \* 1024 \* $agcount` - _scratch_mkfs_xfs -dsize=$size,agcount=$agcount >/dev/null 2>&1 \ + _try_scratch_mkfs_xfs -dsize=$size,agcount=$agcount >/dev/null 2>&1 \ || _fail "mkfs failed" if [ "$use_iflag" = "0" ]; then
common/log +2 -2
@@ -336,7 +336,7 @@ _mkfs_log() # mkfs options to append to log size otion can be specified ($*) export MKFS_OPTIONS="-l size=2000b -l lazy-count=1 $*" _full "mkfs" - _scratch_mkfs_xfs >>$seqres.full 2>&1 + _try_scratch_mkfs_xfs >>$seqres.full 2>&1 if [ $? -ne 0 ] ; then _echofull "Cannot mkfs for this test using option specified: $MKFS_OPTIONS" return 1
@@ -496,7 +496,7 @@ _require_v2log() { # test out mkfs to see if it supports "-l version=2" export MKFS_OPTIONS="-l version=2" - if ! _scratch_mkfs_xfs >>$seqres.full 2>&1; then + if ! _try_scratch_mkfs_xfs >>$seqres.full 2>&1; then _notrun "mkfs does not support v2 logs" fi
common/rc +5 -4
@@ -784,7 +784,7 @@ _scratch_mkfs() return $? ;; xfs) - _scratch_mkfs_xfs $* + _try_scratch_mkfs_xfs $* return $? ;; udf)
@@ -1090,9 +1090,10 @@ _try_scratch_mkfs_sized() # don't override MKFS_OPTIONS that set a block size. echo $MKFS_OPTIONS |grep -E -q "b\s*size=" if [ $? -eq 0 ]; then - _scratch_mkfs_xfs -d size=$fssize $rt_ops + _try_scratch_mkfs_xfs -d size=$fssize $rt_ops else - _scratch_mkfs_xfs -d size=$fssize $rt_ops -b size=$blocksize + _try_scratch_mkfs_xfs -d size=$fssize $rt_ops \ + -b size=$blocksize fi ;; ext2|ext3|ext4)
@@ -1234,7 +1235,7 @@ _scratch_mkfs_blocksized() _scratch_mkfs --sectorsize=$blocksize ;; xfs) - _scratch_mkfs_xfs $MKFS_OPTIONS -b size=$blocksize + _try_scratch_mkfs_xfs $MKFS_OPTIONS -b size=$blocksize ;; ext2|ext3|ext4) _scratch_mkfs_ext4 $MKFS_OPTIONS -b $blocksize
common/xfs +17 -11
@@ -146,7 +146,7 @@ _scratch_find_xfs_min_logblocks() rm -f $tmp.mkfsstd $tmp.mkfserr } -_scratch_mkfs_xfs() +_try_scratch_mkfs_xfs() { local mkfs_cmd="`_scratch_mkfs_xfs_opts`" local mkfs_filter="sed -e '/less than device physical sector/d' \
@@ -180,6 +180,11 @@ _scratch_mkfs_xfs() return $mkfs_status } +_scratch_mkfs_xfs() +{ + _try_scratch_mkfs_xfs $* || _notrun "_scratch_mkfs_xfs failed with ($*)" +} + # Get the number of realtime extents of a mounted filesystem. _xfs_get_rtextents() {
@@ -525,7 +530,7 @@ _require_xfs_has_feature() # _require_scratch_xfs_crc() { - _scratch_mkfs_xfs >/dev/null 2>&1 + _try_scratch_mkfs_xfs >/dev/null 2>&1 _try_scratch_mount >/dev/null 2>&1 \ || _notrun "Kernel doesn't support crc feature" _require_xfs_has_feature $SCRATCH_MNT crc -u \
@@ -545,7 +550,7 @@ _require_xfs_mkfs_finobt() # _require_xfs_finobt() { - _scratch_mkfs_xfs -m crc=1,finobt=1 >/dev/null 2>&1 + _try_scratch_mkfs_xfs -m crc=1,finobt=1 >/dev/null 2>&1 _try_scratch_mount >/dev/null 2>&1 \ || _notrun "Kernel doesn't support finobt feature" _scratch_unmount
@@ -573,7 +578,7 @@ _require_xfs_sparse_inodes() { _scratch_mkfs_xfs_supported -m crc=1 -i sparse > /dev/null 2>&1 \ || _notrun "mkfs.xfs does not support sparse inodes" - _scratch_mkfs_xfs -m crc=1 -i sparse > /dev/null 2>&1 + _try_scratch_mkfs_xfs -m crc=1 -i sparse > /dev/null 2>&1 _try_scratch_mount >/dev/null 2>&1 \ || _notrun "kernel does not support sparse inodes" _scratch_unmount
@@ -585,7 +590,7 @@ _require_xfs_nrext64() { _scratch_mkfs_xfs_supported -m crc=1 -i nrext64 > /dev/null 2>&1 \ || _notrun "mkfs.xfs does not support nrext64" - _scratch_mkfs_xfs -m crc=1 -i nrext64 > /dev/null 2>&1 + _try_scratch_mkfs_xfs -m crc=1 -i nrext64 > /dev/null 2>&1 _try_scratch_mount >/dev/null 2>&1 \ || _notrun "kernel does not support nrext64" _scratch_unmount
@@ -600,7 +605,7 @@ _require_xfs_db_command() fi command=$1 - _scratch_mkfs_xfs >/dev/null 2>&1 + _try_scratch_mkfs_xfs >/dev/null 2>&1 _scratch_xfs_db -x -c "help" | grep $command > /dev/null || \ _notrun "xfs_db $command support is missing" }
@@ -1276,7 +1281,7 @@ _require_scratch_xfs_shrink() _require_scratch _require_command "$XFS_GROWFS_PROG" xfs_growfs - _scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs >/dev/null + _try_scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs >/dev/null . $tmp.mkfs _scratch_mount # here just to check if kernel supports, no need do more extra work
@@ -1581,7 +1586,7 @@ _try_wipe_scratch_xfs() # Try to wipe each SB by default mkfs.xfs geometry local tmp=`mktemp -u` unset agcount agsize dbsize - _scratch_mkfs_xfs -N 2>/dev/null | perl -ne ' + _try_scratch_mkfs_xfs -N 2>/dev/null | perl -ne ' if (/^meta-data=.*\s+agcount=(\d+), agsize=(\d+) blks/) { print STDOUT "agcount=$1\nagsize=$2\n"; }
@@ -1814,7 +1819,8 @@ _scratch_xfs_create_fake_root() # A large stripe unit will put the root inode out quite far # due to alignment, leaving free blocks ahead of it. - _scratch_mkfs_xfs -d sunit=1024,swidth=1024 > $seqres.full 2>&1 || _fail "mkfs failed" + _try_scratch_mkfs_xfs -d sunit=1024,swidth=1024 > $seqres.full 2>&1 || \ + _fail "mkfs failed" # Mounting /without/ a stripe should allow inodes to be allocated # in lower free blocks, without the stripe alignment.
@@ -1983,7 +1989,7 @@ _xfs_discard_max_offset_kb() # check if mkfs and the kernel support nocrc (v4) file systems _require_xfs_nocrc() { - _scratch_mkfs_xfs -m crc=0 > /dev/null 2>&1 || \ + _try_scratch_mkfs_xfs -m crc=0 > /dev/null 2>&1 || \ _notrun "v4 file systems not supported" _try_scratch_mount > /dev/null 2>&1 || \ _notrun "v4 file systems not supported"
@@ -2012,7 +2018,7 @@ _require_xfs_parent() { _scratch_mkfs_xfs_supported -n parent > /dev/null 2>&1 \ || _notrun "mkfs.xfs does not support parent pointers" - _scratch_mkfs_xfs -n parent > /dev/null 2>&1 + _try_scratch_mkfs_xfs -n parent > /dev/null 2>&1 _try_scratch_mount >/dev/null 2>&1 \ || _notrun "kernel does not support parent pointers" _scratch_unmount
tests/generic/083 +1 -2
@@ -45,8 +45,7 @@ workout() echo "" >>$seqres.full if [ $FSTYP = xfs ] then - _scratch_mkfs_xfs -dsize=$fsz,agcount=$ags >>$seqres.full 2>&1 \ - || _fail "size=$fsz,agcount=$ags mkfs failed" + _scratch_mkfs_xfs -dsize=$fsz,agcount=$ags >>$seqres.full 2>&1 else _scratch_mkfs_sized $fsz >>$seqres.full 2>&1 fi
tests/xfs/002 +1 -1
@@ -24,7 +24,7 @@ _require_scratch_nocheck _require_no_large_scratch_dev _require_xfs_nocrc -_scratch_mkfs_xfs -m crc=0 -d size=128m >> $seqres.full 2>&1 || _fail "mkfs failed" +_scratch_mkfs_xfs -m crc=0 -d size=128m >> $seqres.full 2>&1 # Scribble past a couple V4 secondary superblocks to populate sb_crc # (We can't write to the structure member because it doesn't exist
tests/xfs/004 +1 -1
@@ -21,7 +21,7 @@ _cleanup() _populate_scratch() { echo "=== mkfs output ===" >>$seqres.full - _scratch_mkfs_xfs | tee -a $seqres.full | _filter_mkfs 2>$tmp.mkfs + _try_scratch_mkfs_xfs | tee -a $seqres.full | _filter_mkfs 2>$tmp.mkfs . $tmp.mkfs _scratch_mount # This test looks at specific behaviors of the xfs_db freesp command,
tests/xfs/005 +1 -1
@@ -20,7 +20,7 @@ _begin_fstest auto quick _require_scratch_nocheck -_scratch_mkfs_xfs -m crc=1 >> $seqres.full 2>&1 || _fail "mkfs failed" +_scratch_mkfs_xfs -m crc=1 >> $seqres.full 2>&1 # Zap the crc. xfs_db updates the CRC post-write, so poke it directly $XFS_IO_PROG -c "pwrite 224 4" -c fsync $SCRATCH_DEV | _filter_xfs_io
tests/xfs/009 +1 -1
@@ -19,7 +19,7 @@ _cleanup() _init() { echo "*** mkfs" - if ! _scratch_mkfs_xfs >$tmp.out 2>&1 + if ! _try_scratch_mkfs_xfs >$tmp.out 2>&1 then cat $tmp.out echo "failed to mkfs $SCRATCH_DEV"
tests/xfs/017 +1 -2
@@ -33,8 +33,7 @@ echo "*** init FS" _scratch_unmount >/dev/null 2>&1 echo "*** MKFS ***" >>$seqres.full echo "" >>$seqres.full -_scratch_mkfs_xfs >>$seqres.full 2>&1 \ - || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full 2>&1 _scratch_mount echo "*** test"
tests/xfs/019 +1 -2
@@ -99,8 +99,7 @@ _verify_fs() _scratch_unmount >/dev/null 2>&1 _full "mkfs" - _scratch_mkfs_xfs $VERSION -p $protofile >>$seqfull 2>&1 \ - || _fail "mkfs failed" + _scratch_mkfs_xfs $VERSION -p $protofile >>$seqfull 2>&1 echo "*** check FS" _check_scratch_fs
tests/xfs/021 +1 -2
@@ -59,8 +59,7 @@ _require_attrs _scratch_unmount >/dev/null 2>&1 echo "*** mkfs" -_scratch_mkfs_xfs >/dev/null \ - || _fail "mkfs failed" +_scratch_mkfs_xfs >/dev/null echo "*** mount FS" _scratch_mount
tests/xfs/022 +1 -1
@@ -28,7 +28,7 @@ _cleanup() _require_tape $TAPE_DEV _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount # note: fsstress uses an endian dependent random number generator, running this
tests/xfs/023 +1 -1
@@ -27,7 +27,7 @@ _cleanup() _require_tape $TAPE_DEV _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_fill _erase_hard
tests/xfs/024 +1 -1
@@ -25,7 +25,7 @@ _cleanup() _require_tape $TAPE_DEV _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_fill # ensure file/dir timestamps precede dump timestamp
tests/xfs/025 +1 -1
@@ -25,7 +25,7 @@ _cleanup() _require_tape $TAPE_DEV _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_fill _erase_hard
tests/xfs/026 +1 -1
@@ -23,7 +23,7 @@ _cleanup() . ./common/dump _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_fill
tests/xfs/027 +1 -1
@@ -23,7 +23,7 @@ _cleanup() . ./common/dump _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_fill
tests/xfs/028 +1 -1
@@ -23,7 +23,7 @@ _cleanup() . ./common/dump _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount #
tests/xfs/030 +1 -1
@@ -57,7 +57,7 @@ DSIZE="-dsize=100m,agcount=6" # superblock (hanging around from earlier tests)... # -_scratch_mkfs_xfs $DSIZE >/dev/null 2>&1 +_try_scratch_mkfs_xfs $DSIZE >/dev/null 2>&1 if [ $? -ne 0 ] # probably don't have a big enough scratch then _notrun "SCRATCH_DEV too small, results would be non-deterministic"
tests/xfs/034 +1 -2
@@ -29,8 +29,7 @@ echo "*** init FS" _scratch_unmount >/dev/null 2>&1 echo "*** MKFS ***" >>$seqres.full echo "" >>$seqres.full -_scratch_mkfs_xfs >>$seqres.full 2>&1 \ - || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount echo "*** test"
tests/xfs/035 +1 -1
@@ -24,7 +24,7 @@ _cleanup() _require_tape $TAPE_DEV _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_fill _erase_hard
tests/xfs/036 +1 -1
@@ -24,7 +24,7 @@ _cleanup() _require_tape $RMT_IRIXTAPE_DEV _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_fill _erase_soft
tests/xfs/037 +1 -1
@@ -23,7 +23,7 @@ _cleanup() _require_tape $RMT_TAPE_DEV _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_fill _erase_soft
tests/xfs/038 +1 -1
@@ -23,7 +23,7 @@ _cleanup() _require_tape $RMT_TAPE_DEV _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_fill _erase_hard
tests/xfs/039 +1 -1
@@ -24,7 +24,7 @@ _cleanup() _require_tape $RMT_IRIXTAPE_DEV _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_fill _erase_soft
tests/xfs/041 +1 -1
@@ -38,7 +38,7 @@ _fill() _do_die_on_error=message_only agsize=32 echo -n "Make $agsize megabyte filesystem on SCRATCH_DEV and mount... " -_scratch_mkfs_xfs -dsize=${agsize}m,agcount=1 2>&1 >/dev/null || _fail "mkfs failed" +_scratch_mkfs_xfs -dsize=${agsize}m,agcount=1 2>&1 >/dev/null bsize=`_scratch_mkfs_xfs -dsize=${agsize}m,agcount=1 2>&1 | _filter_mkfs 2>&1 \ | perl -ne 'if (/dbsize=(\d+)/) {print $1;}'` onemeginblocks=`expr 1048576 / $bsize`
tests/xfs/042 +1 -1
@@ -50,7 +50,7 @@ _require_scratch _do_die_on_error=message_only echo -n "Make a 96 megabyte filesystem on SCRATCH_DEV and mount... " -_scratch_mkfs_xfs -dsize=96m,agcount=3 2>&1 >/dev/null || _fail "mkfs failed" +_scratch_mkfs_xfs -dsize=96m,agcount=3 2>&1 >/dev/null _scratch_mount echo "done"
tests/xfs/043 +1 -1
@@ -26,7 +26,7 @@ _cleanup() _require_tape $TAPE_DEV _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_fill _erase_hard
tests/xfs/044 +1 -1
@@ -73,7 +73,7 @@ echo "*** mkfs" # this test only works for version 1 logs currently lversion=1 lsize=16777216 -_scratch_mkfs_xfs -lsize=$lsize,version=$lversion >$tmp.mkfs0 2>&1 +_try_scratch_mkfs_xfs -lsize=$lsize,version=$lversion >$tmp.mkfs0 2>&1 [ $? -ne 0 ] && \ _notrun "Cannot mkfs for this test using MKFS_OPTIONS specified" _filter_mkfs <$tmp.mkfs0 2>$tmp.mkfs1
tests/xfs/045 +1 -1
@@ -25,7 +25,7 @@ echo "*** get uuid" uuid=`_get_existing_uuid` echo "*** mkfs" -if ! _scratch_mkfs_xfs >$tmp.out 2>&1 +if ! _try_scratch_mkfs_xfs >$tmp.out 2>&1 then cat $tmp.out echo "!!! failed to mkfs on $SCRATCH_DEV"
tests/xfs/046 +1 -1
@@ -21,7 +21,7 @@ _cleanup() . ./common/dump _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_symlinks
tests/xfs/047 +1 -1
@@ -21,7 +21,7 @@ _cleanup() . ./common/dump _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount #
tests/xfs/055 +1 -1
@@ -24,7 +24,7 @@ _cleanup() _require_tape $RMT_TAPE_USER@$RMT_IRIXTAPE_DEV _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_fill
tests/xfs/056 +1 -1
@@ -24,7 +24,7 @@ _cleanup() . ./common/dump _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_fill_perm
tests/xfs/059 +1 -1
@@ -25,7 +25,7 @@ _cleanup() _require_multi_stream _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_fill_multi
tests/xfs/060 +1 -1
@@ -25,7 +25,7 @@ _cleanup() _require_multi_stream _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_fill_multi
tests/xfs/061 +1 -1
@@ -23,7 +23,7 @@ _cleanup() . ./common/dump _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount # src/dumpfile based on dumping from
tests/xfs/063 +1 -1
@@ -25,7 +25,7 @@ _cleanup() _require_attrs trusted user _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount # create files with EAs
tests/xfs/064 +1 -1
@@ -35,7 +35,7 @@ _ls_size_filter() } _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_hardlinks 9
tests/xfs/066 +1 -1
@@ -36,7 +36,7 @@ else _notrun "Installed libc doesn't correctly handle setrlimit/ftruncate64" fi -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_largefile echo "ls dumpdir/largefile"
tests/xfs/068 +1 -1
@@ -27,7 +27,7 @@ _cleanup() . ./common/dump _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_stress_num 4096
tests/xfs/070 +0 -1
@@ -75,7 +75,6 @@ _require_scratch_nocheck _require_command "$KILLALL_PROG" killall _scratch_mkfs | _filter_mkfs > /dev/null 2> $tmp.mkfs -test "${PIPESTATUS[0]}" -eq 0 || _fail "mkfs failed" . $tmp.mkfs # import agcount
tests/xfs/072 +1 -1
@@ -26,7 +26,7 @@ _require_xfs_io_command "falloc" _scratch_unmount >/dev/null 2>&1 -_scratch_mkfs_xfs >/dev/null || _fail "mkfs failed" +_scratch_mkfs_xfs >/dev/null _scratch_mount # check there's enough freespace on $SCRATCH_MNT ... (1GiB + 1MiB)
tests/xfs/077 +1 -1
@@ -48,7 +48,7 @@ _fs_has_META_UUID() $XFS_DB_PROG -r -c version $FS | grep -q META_UUID } -_scratch_mkfs_xfs -m crc=1 >> $seqres.full 2>&1 || _fail "mkfs failed" +_scratch_mkfs_xfs -m crc=1 >> $seqres.full 2>&1 ORIG_UUID=`_scratch_xfs_db -c "uuid" | awk '{print $NF}'`
tests/xfs/090 +1 -1
@@ -23,7 +23,7 @@ _filter_io() _create_scratch() { echo "*** mkfs" - if ! _scratch_mkfs_xfs >$tmp.out 2>&1 + if ! _try_scratch_mkfs_xfs >$tmp.out 2>&1 then cat $tmp.out echo "failed to mkfs $SCRATCH_DEV"
tests/xfs/094 +1 -1
@@ -38,7 +38,7 @@ _filter_rtinherit_flag() _create_scratch() { echo "*** mkfs" - if ! _scratch_mkfs_xfs >$tmp.out 2>&1 + if ! _try_scratch_mkfs_xfs >$tmp.out 2>&1 then cat $tmp.out echo "failed to mkfs $SCRATCH_DEV"
tests/xfs/103 +1 -1
@@ -15,7 +15,7 @@ _begin_fstest metadata dir ioctl auto quick _create_scratch() { echo "*** mkfs" - if ! _scratch_mkfs_xfs >$tmp.out 2>&1 + if ! _try_scratch_mkfs_xfs >$tmp.out 2>&1 then cat $tmp.out echo "failed to mkfs $SCRATCH_DEV"
tests/xfs/121 +1 -2
@@ -23,8 +23,7 @@ rm -f $tmp.log _require_scratch echo "mkfs" -_scratch_mkfs_xfs >>$seqres.full 2>&1 \ - || _fail "mkfs scratch failed" +_scratch_mkfs_xfs >>$seqres.full 2>&1 echo "mount" _scratch_mount
tests/xfs/153 +1 -1
@@ -73,7 +73,7 @@ _filter_and_check_blks() run_tests() { - _scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs + _try_scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs cat $tmp.mkfs >>$seqres.full # keep the blocksize and data size for dd later
tests/xfs/168 +2 -2
@@ -18,7 +18,7 @@ _begin_fstest auto growfs shrinkfs ioctl prealloc stress create_scratch() { - _scratch_mkfs_xfs $@ | tee -a $seqres.full | \ + _try_scratch_mkfs_xfs $@ | tee -a $seqres.full | \ _filter_mkfs 2>$tmp.mkfs >/dev/null . $tmp.mkfs
@@ -46,7 +46,7 @@ stress_scratch() _require_scratch_xfs_shrink _require_xfs_io_command "falloc" -_scratch_mkfs_xfs | tee -a $seqres.full | _filter_mkfs 2>$tmp.mkfs >/dev/null +_try_scratch_mkfs_xfs | tee -a $seqres.full | _filter_mkfs 2>$tmp.mkfs >/dev/null . $tmp.mkfs # extract blocksize and data size for scratch device endsize=`expr 125 \* 1048576` # stop after shrinking this big
tests/xfs/178 +2 -4
@@ -52,7 +52,6 @@ _dd_repair_check() _require_scratch _scratch_xfs_force_no_metadir _scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs -test "${PIPESTATUS[0]}" -eq 0 || _fail "mkfs failed!" # By executing the followint tmp file, will get on the mkfs options stored in # variables
@@ -61,7 +60,7 @@ test "${PIPESTATUS[0]}" -eq 0 || _fail "mkfs failed!" # if the default agcount is too small, bump it up and re-mkfs before testing if [ $agcount -lt 8 ]; then agcount=8 - _scratch_mkfs_xfs -dagcount=$agcount >/dev/null 2>&1 \ + _try_scratch_mkfs_xfs -dagcount=$agcount >/dev/null 2>&1 \ || _notrun "Test requires at least 8 AGs." fi
@@ -69,8 +68,7 @@ _dd_repair_check $SCRATCH_DEV $sectsz # smaller AGCOUNT let "agcount=$agcount-2" -_scratch_mkfs_xfs -dagcount=$agcount >/dev/null 2>&1 \ - || _fail "mkfs failed!" +_scratch_mkfs_xfs -dagcount=$agcount >/dev/null 2>&1 _dd_repair_check $SCRATCH_DEV $sectsz
tests/xfs/181 +1 -2
@@ -32,8 +32,7 @@ rm -f $tmp.log _require_scratch echo "mkfs" -_scratch_mkfs_xfs >>$seqres.full 2>&1 \ - || _fail "mkfs scratch failed" +_scratch_mkfs_xfs >>$seqres.full 2>&1 echo "mount" _scratch_mount
tests/xfs/183 +1 -2
@@ -18,8 +18,7 @@ _begin_fstest rw other auto quick # Setup Filesystem _require_scratch -_scratch_mkfs_xfs >/dev/null 2>&1 \ - || _fail "mkfs failed" +_scratch_mkfs_xfs >/dev/null 2>&1 _scratch_mount
tests/xfs/202 +1 -2
@@ -24,8 +24,7 @@ _require_scratch_nocheck # a single AG filesystem. # echo "== Creating single-AG filesystem ==" -_scratch_mkfs_xfs -d agcount=1 -d size=$((1024*1024*1024)) >/dev/null 2>&1 \ - || _fail "!!! failed to make filesystem with single AG" +_scratch_mkfs_xfs -d agcount=1 -d size=$((1024*1024*1024)) >/dev/null 2>&1 echo "== Trying to repair it (should fail) ==" _scratch_xfs_repair
tests/xfs/244 +2 -2
@@ -29,7 +29,7 @@ _require_projid16bit export MOUNT_OPTIONS="-opquota" # make fs with no projid32bit -_scratch_mkfs_xfs -i projid32bit=0 >> $seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs -i projid32bit=0 >> $seqres.full _qmount # make sure project quota is supported _require_prjquota ${SCRATCH_DEV}
@@ -73,7 +73,7 @@ fi # Do testing on filesystem with projid32bit feature enabled _scratch_unmount 2>/dev/null -_scratch_mkfs_xfs -i projid32bit=1 >> $seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs -i projid32bit=1 >> $seqres.full _qmount mkdir $dir
tests/xfs/266 +1 -1
@@ -55,7 +55,7 @@ if [ $? -ne 0 ]; then _notrun "requires xfsdump -D" fi -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_fill # ensure file/dir timestamps precede dump timestamp
tests/xfs/267 +1 -1
@@ -46,7 +46,7 @@ End-of-File _require_tape $TAPE_DEV _require_attrs trusted _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_files
tests/xfs/268 +1 -1
@@ -49,7 +49,7 @@ End-of-File _require_tape $TAPE_DEV _require_attrs trusted user _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_files
tests/xfs/281 +1 -1
@@ -22,7 +22,7 @@ _cleanup() _require_legacy_v2_format _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_fill
tests/xfs/282 +1 -1
@@ -24,7 +24,7 @@ _cleanup() _require_legacy_v2_format _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_fill
tests/xfs/283 +1 -1
@@ -24,7 +24,7 @@ _cleanup() _require_legacy_v2_format _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_fill
tests/xfs/287 +1 -2
@@ -35,8 +35,7 @@ _require_projid32bit _require_projid16bit # create xfs fs without projid32bit ability, will be gained by xfs_admin -_scratch_mkfs_xfs -i projid32bit=0 -d size=200m >> $seqres.full \ - || _fail "mkfs failed" +_scratch_mkfs_xfs -i projid32bit=0 -d size=200m >> $seqres.full _qmount_option "pquota" _qmount # require project quotas
tests/xfs/296 +1 -1
@@ -26,7 +26,7 @@ _cleanup() _require_scratch _require_command "$SETCAP_PROG" setcap _require_command "$GETCAP_PROG" getcap -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount mkdir -p $dump_dir
tests/xfs/300 +1 -2
@@ -20,8 +20,7 @@ _require_xfs_nocrc getenforce | grep -q "Enforcing\|Permissive" || _notrun "SELinux not enabled" [ "$XFS_FSR_PROG" = "" ] && _notrun "xfs_fsr not found" -_scratch_mkfs_xfs -m crc=0 -i size=256 >> $seqres.full 2>&1 \ - || _fail "mkfs failed" +_scratch_mkfs_xfs -m crc=0 -i size=256 >> $seqres.full 2>&1 # Manually mount to avoid fs-wide context set by default in xfstests mount $SCRATCH_DEV $SCRATCH_MNT
tests/xfs/301 +1 -1
@@ -25,7 +25,7 @@ _cleanup() # Modify as appropriate. _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount # Extended attributes
tests/xfs/302 +1 -1
@@ -24,7 +24,7 @@ _cleanup() # Modify as appropriate. _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount echo "Silence is golden."
tests/xfs/306 +1 -2
@@ -30,8 +30,7 @@ unset SCRATCH_RTDEV # Create a small fs with a large directory block size. We want to fill up the fs # quickly and then create multi-fsb dirblocks over fragmented free space. -_scratch_mkfs_xfs -d size=100m -n size=64k >> $seqres.full 2>&1 || \ - _notrun 'could not format tiny scratch fs' +_scratch_mkfs_xfs -d size=100m -n size=64k >> $seqres.full 2>&1 _scratch_mount # Fill a source directory with many largish-named files. 1k uuid-named entries
tests/xfs/445 +1 -2
@@ -45,8 +45,7 @@ _check_filestreams_support || _notrun "filestreams not available" unset SCRATCH_RTDEV # use small AGs for frequent stream switching -_scratch_mkfs_xfs -d agsize=20m,size=2g >> $seqres.full 2>&1 || - _fail "mkfs failed" +_scratch_mkfs_xfs -d agsize=20m,size=2g >> $seqres.full 2>&1 _scratch_mount "-o filestreams" # start background inode reclaim
tests/xfs/448 +0 -1
@@ -33,7 +33,6 @@ rm -f "$seqres.full" # Format and mount _scratch_mkfs | _filter_mkfs > $seqres.full 2> $tmp.mkfs -test "${PIPESTATUS[0]}" -eq 0 || _fail "mkfs failed" _scratch_mount # Get directory block size
tests/xfs/520 +1 -1
@@ -34,7 +34,7 @@ _require_scratch_nocheck unset USE_EXTERNAL force_crafted_metadata() { - _scratch_mkfs_xfs -f $fsdsopt "$4" >> $seqres.full 2>&1 || _fail "mkfs failed" + _scratch_mkfs_xfs -f $fsdsopt "$4" >> $seqres.full 2>&1 _scratch_xfs_set_metadata_field "$1" "$2" "$3" >> $seqres.full 2>&1 local kmsg="xfs/$seq: testing $1=$2 at $(date +"%F %T")" local mounted=0
tests/xfs/596 +0 -1
@@ -39,7 +39,6 @@ _do_die_on_error=message_only rtsize=32 echo -n "Make $rtsize megabyte rt filesystem on SCRATCH_DEV and mount... " _scratch_mkfs_xfs -rsize=${rtsize}m | _filter_mkfs 2> "$tmp.mkfs" >> $seqres.full -test "${PIPESTATUS[0]}" -eq 0 || _fail "mkfs failed" . $tmp.mkfs onemeginblocks=`expr 1048576 / $dbsize`
Signature · 1 line
2.43.0
Re: [PATCH 2/4] common: _notrun if _scratch_mkfs_xfs failed
Quoted 15 lines · Christoph Hellwig
If we fail to create a file system with specific passed in options, that that these options conflict with other options $MKFS_OPTIONS. Don't fail the test case for that, but instead
_norunit and display the options that caused it to fail.Add a lower-level
_try_scratch_mkfs_xfshelper for those places that want to check the return value.Signed-off-by Christoph Hellwig <[email protected]>--- common/attr | 4 ++-- common/filestreams | 2 +- common/log | 4 ++-- common/rc | 9 +++++---- common/xfs | 28 +++++++++++++++++-----------
[snip]
common/rc _scratch_mkfs() · line 787
Quoted 10 lines
common/rc +1
-1@@ -784,7 +784,7 @@ _scratch_mkfs() return $? ;; xfs) - _scratch_mkfs_xfs $* + _try_scratch_mkfs_xfs $*
I thought you might want to affect all test cases (on xfs), until I see this :)
So most of cases (on xfs) will be not changed, only those cases call _scratch_mkfs_xfs directly will be _notrun (if it fails to mkfs before).
I'm still thinking about if this behavior is needed. Last time we just let _scratch_mkfs_sized calls _fail if it fails to mkfs. And we hope to get a fail report generally, if a mkfs fails. But now we hope to _notrun? With this patchset, some mkfs failures will cause _fail, but some will cause _notrun. There'll be two kind of behaviors.
Thanks,
Zorro
Quoted 1,075 lines
common/rc +4
-3return $? ;; udf)@@ -1090,9 +1090,10 @@ _try_scratch_mkfs_sized() # don't override MKFS_OPTIONS that set a block size. echo $MKFS_OPTIONS |grep -E -q "b\s*size=" if [ $? -eq 0 ]; then - _scratch_mkfs_xfs -d size=$fssize $rt_ops + _try_scratch_mkfs_xfs -d size=$fssize $rt_ops else - _scratch_mkfs_xfs -d size=$fssize $rt_ops -b size=$blocksize + _try_scratch_mkfs_xfs -d size=$fssize $rt_ops \ + -b size=$blocksize fi ;; ext2|ext3|ext4)@@ -1234,7 +1235,7 @@ _scratch_mkfs_blocksized() _scratch_mkfs --sectorsize=$blocksize ;; xfs) - _scratch_mkfs_xfs $MKFS_OPTIONS -b size=$blocksize + _try_scratch_mkfs_xfs $MKFS_OPTIONS -b size=$blocksize ;; ext2|ext3|ext4) _scratch_mkfs_ext4 $MKFS_OPTIONS -b $blocksizecommon/xfs +17
-11@@ -146,7 +146,7 @@ _scratch_find_xfs_min_logblocks() rm -f $tmp.mkfsstd $tmp.mkfserr } -_scratch_mkfs_xfs() +_try_scratch_mkfs_xfs() { local mkfs_cmd="`_scratch_mkfs_xfs_opts`" local mkfs_filter="sed -e '/less than device physical sector/d' \@@ -180,6 +180,11 @@ _scratch_mkfs_xfs() return $mkfs_status } +_scratch_mkfs_xfs() +{ + _try_scratch_mkfs_xfs $* || _notrun "_scratch_mkfs_xfs failed with ($*)" +} + # Get the number of realtime extents of a mounted filesystem. _xfs_get_rtextents() {@@ -525,7 +530,7 @@ _require_xfs_has_feature() # _require_scratch_xfs_crc() { - _scratch_mkfs_xfs >/dev/null 2>&1 + _try_scratch_mkfs_xfs >/dev/null 2>&1 _try_scratch_mount >/dev/null 2>&1 \ || _notrun "Kernel doesn't support crc feature" _require_xfs_has_feature $SCRATCH_MNT crc -u \@@ -545,7 +550,7 @@ _require_xfs_mkfs_finobt() # _require_xfs_finobt() { - _scratch_mkfs_xfs -m crc=1,finobt=1 >/dev/null 2>&1 + _try_scratch_mkfs_xfs -m crc=1,finobt=1 >/dev/null 2>&1 _try_scratch_mount >/dev/null 2>&1 \ || _notrun "Kernel doesn't support finobt feature" _scratch_unmount@@ -573,7 +578,7 @@ _require_xfs_sparse_inodes() { _scratch_mkfs_xfs_supported -m crc=1 -i sparse > /dev/null 2>&1 \ || _notrun "mkfs.xfs does not support sparse inodes" - _scratch_mkfs_xfs -m crc=1 -i sparse > /dev/null 2>&1 + _try_scratch_mkfs_xfs -m crc=1 -i sparse > /dev/null 2>&1 _try_scratch_mount >/dev/null 2>&1 \ || _notrun "kernel does not support sparse inodes" _scratch_unmount@@ -585,7 +590,7 @@ _require_xfs_nrext64() { _scratch_mkfs_xfs_supported -m crc=1 -i nrext64 > /dev/null 2>&1 \ || _notrun "mkfs.xfs does not support nrext64" - _scratch_mkfs_xfs -m crc=1 -i nrext64 > /dev/null 2>&1 + _try_scratch_mkfs_xfs -m crc=1 -i nrext64 > /dev/null 2>&1 _try_scratch_mount >/dev/null 2>&1 \ || _notrun "kernel does not support nrext64" _scratch_unmount@@ -600,7 +605,7 @@ _require_xfs_db_command() fi command=$1 - _scratch_mkfs_xfs >/dev/null 2>&1 + _try_scratch_mkfs_xfs >/dev/null 2>&1 _scratch_xfs_db -x -c "help" | grep $command > /dev/null || \ _notrun "xfs_db $command support is missing" }@@ -1276,7 +1281,7 @@ _require_scratch_xfs_shrink() _require_scratch _require_command "$XFS_GROWFS_PROG" xfs_growfs - _scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs >/dev/null + _try_scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs >/dev/null . $tmp.mkfs _scratch_mount # here just to check if kernel supports, no need do more extra work@@ -1581,7 +1586,7 @@ _try_wipe_scratch_xfs() # Try to wipe each SB by default mkfs.xfs geometry local tmp=`mktemp -u` unset agcount agsize dbsize - _scratch_mkfs_xfs -N 2>/dev/null | perl -ne ' + _try_scratch_mkfs_xfs -N 2>/dev/null | perl -ne ' if (/^meta-data=.*\s+agcount=(\d+), agsize=(\d+) blks/) { print STDOUT "agcount=$1\nagsize=$2\n"; }@@ -1814,7 +1819,8 @@ _scratch_xfs_create_fake_root() # A large stripe unit will put the root inode out quite far # due to alignment, leaving free blocks ahead of it. - _scratch_mkfs_xfs -d sunit=1024,swidth=1024 > $seqres.full 2>&1 || _fail "mkfs failed" + _try_scratch_mkfs_xfs -d sunit=1024,swidth=1024 > $seqres.full 2>&1 || \ + _fail "mkfs failed" # Mounting /without/ a stripe should allow inodes to be allocated # in lower free blocks, without the stripe alignment.@@ -1983,7 +1989,7 @@ _xfs_discard_max_offset_kb() # check if mkfs and the kernel support nocrc (v4) file systems _require_xfs_nocrc() { - _scratch_mkfs_xfs -m crc=0 > /dev/null 2>&1 || \ + _try_scratch_mkfs_xfs -m crc=0 > /dev/null 2>&1 || \ _notrun "v4 file systems not supported" _try_scratch_mount > /dev/null 2>&1 || \ _notrun "v4 file systems not supported"@@ -2012,7 +2018,7 @@ _require_xfs_parent() { _scratch_mkfs_xfs_supported -n parent > /dev/null 2>&1 \ || _notrun "mkfs.xfs does not support parent pointers" - _scratch_mkfs_xfs -n parent > /dev/null 2>&1 + _try_scratch_mkfs_xfs -n parent > /dev/null 2>&1 _try_scratch_mount >/dev/null 2>&1 \ || _notrun "kernel does not support parent pointers" _scratch_unmounttests/generic/083 +1
-2@@ -45,8 +45,7 @@ workout() echo "" >>$seqres.full if [ $FSTYP = xfs ] then - _scratch_mkfs_xfs -dsize=$fsz,agcount=$ags >>$seqres.full 2>&1 \ - || _fail "size=$fsz,agcount=$ags mkfs failed" + _scratch_mkfs_xfs -dsize=$fsz,agcount=$ags >>$seqres.full 2>&1 else _scratch_mkfs_sized $fsz >>$seqres.full 2>&1 fitests/xfs/002 +1
-1@@ -24,7 +24,7 @@ _require_scratch_nocheck _require_no_large_scratch_dev _require_xfs_nocrc -_scratch_mkfs_xfs -m crc=0 -d size=128m >> $seqres.full 2>&1 || _fail "mkfs failed" +_scratch_mkfs_xfs -m crc=0 -d size=128m >> $seqres.full 2>&1 # Scribble past a couple V4 secondary superblocks to populate sb_crc # (We can't write to the structure member because it doesn't existtests/xfs/004 +1
-1@@ -21,7 +21,7 @@ _cleanup() _populate_scratch() { echo "=== mkfs output ===" >>$seqres.full - _scratch_mkfs_xfs | tee -a $seqres.full | _filter_mkfs 2>$tmp.mkfs + _try_scratch_mkfs_xfs | tee -a $seqres.full | _filter_mkfs 2>$tmp.mkfs . $tmp.mkfs _scratch_mount # This test looks at specific behaviors of the xfs_db freesp command,tests/xfs/005 +1
-1@@ -20,7 +20,7 @@ _begin_fstest auto quick _require_scratch_nocheck -_scratch_mkfs_xfs -m crc=1 >> $seqres.full 2>&1 || _fail "mkfs failed" +_scratch_mkfs_xfs -m crc=1 >> $seqres.full 2>&1 # Zap the crc. xfs_db updates the CRC post-write, so poke it directly $XFS_IO_PROG -c "pwrite 224 4" -c fsync $SCRATCH_DEV | _filter_xfs_iotests/xfs/009 +1
-1@@ -19,7 +19,7 @@ _cleanup() _init() { echo "*** mkfs" - if ! _scratch_mkfs_xfs >$tmp.out 2>&1 + if ! _try_scratch_mkfs_xfs >$tmp.out 2>&1 then cat $tmp.out echo "failed to mkfs $SCRATCH_DEV"tests/xfs/017 +1
-2@@ -33,8 +33,7 @@ echo "*** init FS" _scratch_unmount >/dev/null 2>&1 echo "*** MKFS ***" >>$seqres.full echo "" >>$seqres.full -_scratch_mkfs_xfs >>$seqres.full 2>&1 \ - || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full 2>&1 _scratch_mount echo "*** test"tests/xfs/019 +1
-2@@ -99,8 +99,7 @@ _verify_fs() _scratch_unmount >/dev/null 2>&1 _full "mkfs" - _scratch_mkfs_xfs $VERSION -p $protofile >>$seqfull 2>&1 \ - || _fail "mkfs failed" + _scratch_mkfs_xfs $VERSION -p $protofile >>$seqfull 2>&1 echo "*** check FS" _check_scratch_fstests/xfs/021 +1
-2@@ -59,8 +59,7 @@ _require_attrs _scratch_unmount >/dev/null 2>&1 echo "*** mkfs" -_scratch_mkfs_xfs >/dev/null \ - || _fail "mkfs failed" +_scratch_mkfs_xfs >/dev/null echo "*** mount FS" _scratch_mounttests/xfs/022 +1
-1@@ -28,7 +28,7 @@ _cleanup() _require_tape $TAPE_DEV _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount # note: fsstress uses an endian dependent random number generator, running thistests/xfs/023 +1
-1@@ -27,7 +27,7 @@ _cleanup() _require_tape $TAPE_DEV _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_fill _erase_hardtests/xfs/024 +1
-1@@ -25,7 +25,7 @@ _cleanup() _require_tape $TAPE_DEV _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_fill # ensure file/dir timestamps precede dump timestamptests/xfs/025 +1
-1@@ -25,7 +25,7 @@ _cleanup() _require_tape $TAPE_DEV _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_fill _erase_hardtests/xfs/026 +1
-1@@ -23,7 +23,7 @@ _cleanup() . ./common/dump _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_filltests/xfs/027 +1
-1@@ -23,7 +23,7 @@ _cleanup() . ./common/dump _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_filltests/xfs/028 +1
-1@@ -23,7 +23,7 @@ _cleanup() . ./common/dump _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount #tests/xfs/030 +1
-1@@ -57,7 +57,7 @@ DSIZE="-dsize=100m,agcount=6" # superblock (hanging around from earlier tests)... # -_scratch_mkfs_xfs $DSIZE >/dev/null 2>&1 +_try_scratch_mkfs_xfs $DSIZE >/dev/null 2>&1 if [ $? -ne 0 ] # probably don't have a big enough scratch then _notrun "SCRATCH_DEV too small, results would be non-deterministic"tests/xfs/034 +1
-2@@ -29,8 +29,7 @@ echo "*** init FS" _scratch_unmount >/dev/null 2>&1 echo "*** MKFS ***" >>$seqres.full echo "" >>$seqres.full -_scratch_mkfs_xfs >>$seqres.full 2>&1 \ - || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount echo "*** test"tests/xfs/035 +1
-1@@ -24,7 +24,7 @@ _cleanup() _require_tape $TAPE_DEV _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_fill _erase_hardtests/xfs/036 +1
-1@@ -24,7 +24,7 @@ _cleanup() _require_tape $RMT_IRIXTAPE_DEV _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_fill _erase_softtests/xfs/037 +1
-1@@ -23,7 +23,7 @@ _cleanup() _require_tape $RMT_TAPE_DEV _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_fill _erase_softtests/xfs/038 +1
-1@@ -23,7 +23,7 @@ _cleanup() _require_tape $RMT_TAPE_DEV _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_fill _erase_hardtests/xfs/039 +1
-1@@ -24,7 +24,7 @@ _cleanup() _require_tape $RMT_IRIXTAPE_DEV _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_fill _erase_softtests/xfs/041 +1
-1@@ -38,7 +38,7 @@ _fill() _do_die_on_error=message_only agsize=32 echo -n "Make $agsize megabyte filesystem on SCRATCH_DEV and mount... " -_scratch_mkfs_xfs -dsize=${agsize}m,agcount=1 2>&1 >/dev/null || _fail "mkfs failed" +_scratch_mkfs_xfs -dsize=${agsize}m,agcount=1 2>&1 >/dev/null bsize=`_scratch_mkfs_xfs -dsize=${agsize}m,agcount=1 2>&1 | _filter_mkfs 2>&1 \ | perl -ne 'if (/dbsize=(\d+)/) {print $1;}'` onemeginblocks=`expr 1048576 / $bsize`tests/xfs/042 +1
-1@@ -50,7 +50,7 @@ _require_scratch _do_die_on_error=message_only echo -n "Make a 96 megabyte filesystem on SCRATCH_DEV and mount... " -_scratch_mkfs_xfs -dsize=96m,agcount=3 2>&1 >/dev/null || _fail "mkfs failed" +_scratch_mkfs_xfs -dsize=96m,agcount=3 2>&1 >/dev/null _scratch_mount echo "done"tests/xfs/043 +1
-1@@ -26,7 +26,7 @@ _cleanup() _require_tape $TAPE_DEV _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_fill _erase_hardtests/xfs/044 +1
-1@@ -73,7 +73,7 @@ echo "*** mkfs" # this test only works for version 1 logs currently lversion=1 lsize=16777216 -_scratch_mkfs_xfs -lsize=$lsize,version=$lversion >$tmp.mkfs0 2>&1 +_try_scratch_mkfs_xfs -lsize=$lsize,version=$lversion >$tmp.mkfs0 2>&1 [ $? -ne 0 ] && \ _notrun "Cannot mkfs for this test using MKFS_OPTIONS specified" _filter_mkfs <$tmp.mkfs0 2>$tmp.mkfs1tests/xfs/045 +1
-1@@ -25,7 +25,7 @@ echo "*** get uuid" uuid=`_get_existing_uuid` echo "*** mkfs" -if ! _scratch_mkfs_xfs >$tmp.out 2>&1 +if ! _try_scratch_mkfs_xfs >$tmp.out 2>&1 then cat $tmp.out echo "!!! failed to mkfs on $SCRATCH_DEV"tests/xfs/046 +1
-1@@ -21,7 +21,7 @@ _cleanup() . ./common/dump _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_symlinkstests/xfs/047 +1
-1@@ -21,7 +21,7 @@ _cleanup() . ./common/dump _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount #tests/xfs/055 +1
-1@@ -24,7 +24,7 @@ _cleanup() _require_tape $RMT_TAPE_USER@$RMT_IRIXTAPE_DEV _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_filltests/xfs/056 +1
-1@@ -24,7 +24,7 @@ _cleanup() . ./common/dump _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_fill_permtests/xfs/059 +1
-1@@ -25,7 +25,7 @@ _cleanup() _require_multi_stream _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_fill_multitests/xfs/060 +1
-1@@ -25,7 +25,7 @@ _cleanup() _require_multi_stream _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_fill_multitests/xfs/061 +1
-1@@ -23,7 +23,7 @@ _cleanup() . ./common/dump _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount # src/dumpfile based on dumping fromtests/xfs/063 +1
-1@@ -25,7 +25,7 @@ _cleanup() _require_attrs trusted user _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount # create files with EAstests/xfs/064 +1
-1@@ -35,7 +35,7 @@ _ls_size_filter() } _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_hardlinks 9tests/xfs/066 +1
-1@@ -36,7 +36,7 @@ else _notrun "Installed libc doesn't correctly handle setrlimit/ftruncate64" fi -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_largefile echo "ls dumpdir/largefile"tests/xfs/068 +1
-1@@ -27,7 +27,7 @@ _cleanup() . ./common/dump _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_stress_num 4096tests/xfs/070 +0
-1@@ -75,7 +75,6 @@ _require_scratch_nocheck _require_command "$KILLALL_PROG" killall _scratch_mkfs | _filter_mkfs > /dev/null 2> $tmp.mkfs -test "${PIPESTATUS[0]}" -eq 0 || _fail "mkfs failed" . $tmp.mkfs # import agcounttests/xfs/072 +1
-1@@ -26,7 +26,7 @@ _require_xfs_io_command "falloc" _scratch_unmount >/dev/null 2>&1 -_scratch_mkfs_xfs >/dev/null || _fail "mkfs failed" +_scratch_mkfs_xfs >/dev/null _scratch_mount # check there's enough freespace on $SCRATCH_MNT ... (1GiB + 1MiB)tests/xfs/077 +1
-1@@ -48,7 +48,7 @@ _fs_has_META_UUID() $XFS_DB_PROG -r -c version $FS | grep -q META_UUID } -_scratch_mkfs_xfs -m crc=1 >> $seqres.full 2>&1 || _fail "mkfs failed" +_scratch_mkfs_xfs -m crc=1 >> $seqres.full 2>&1 ORIG_UUID=`_scratch_xfs_db -c "uuid" | awk '{print $NF}'`tests/xfs/090 +1
-1@@ -23,7 +23,7 @@ _filter_io() _create_scratch() { echo "*** mkfs" - if ! _scratch_mkfs_xfs >$tmp.out 2>&1 + if ! _try_scratch_mkfs_xfs >$tmp.out 2>&1 then cat $tmp.out echo "failed to mkfs $SCRATCH_DEV"tests/xfs/094 +1
-1@@ -38,7 +38,7 @@ _filter_rtinherit_flag() _create_scratch() { echo "*** mkfs" - if ! _scratch_mkfs_xfs >$tmp.out 2>&1 + if ! _try_scratch_mkfs_xfs >$tmp.out 2>&1 then cat $tmp.out echo "failed to mkfs $SCRATCH_DEV"tests/xfs/103 +1
-1@@ -15,7 +15,7 @@ _begin_fstest metadata dir ioctl auto quick _create_scratch() { echo "*** mkfs" - if ! _scratch_mkfs_xfs >$tmp.out 2>&1 + if ! _try_scratch_mkfs_xfs >$tmp.out 2>&1 then cat $tmp.out echo "failed to mkfs $SCRATCH_DEV"tests/xfs/121 +1
-2@@ -23,8 +23,7 @@ rm -f $tmp.log _require_scratch echo "mkfs" -_scratch_mkfs_xfs >>$seqres.full 2>&1 \ - || _fail "mkfs scratch failed" +_scratch_mkfs_xfs >>$seqres.full 2>&1 echo "mount" _scratch_mounttests/xfs/153 +1
-1@@ -73,7 +73,7 @@ _filter_and_check_blks() run_tests() { - _scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs + _try_scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs cat $tmp.mkfs >>$seqres.full # keep the blocksize and data size for dd latertests/xfs/168 +2
-2@@ -18,7 +18,7 @@ _begin_fstest auto growfs shrinkfs ioctl prealloc stress create_scratch() { - _scratch_mkfs_xfs $@ | tee -a $seqres.full | \ + _try_scratch_mkfs_xfs $@ | tee -a $seqres.full | \ _filter_mkfs 2>$tmp.mkfs >/dev/null . $tmp.mkfs@@ -46,7 +46,7 @@ stress_scratch() _require_scratch_xfs_shrink _require_xfs_io_command "falloc" -_scratch_mkfs_xfs | tee -a $seqres.full | _filter_mkfs 2>$tmp.mkfs >/dev/null +_try_scratch_mkfs_xfs | tee -a $seqres.full | _filter_mkfs 2>$tmp.mkfs >/dev/null . $tmp.mkfs # extract blocksize and data size for scratch device endsize=`expr 125 \* 1048576` # stop after shrinking this bigtests/xfs/178 +2
-4@@ -52,7 +52,6 @@ _dd_repair_check() _require_scratch _scratch_xfs_force_no_metadir _scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs -test "${PIPESTATUS[0]}" -eq 0 || _fail "mkfs failed!" # By executing the followint tmp file, will get on the mkfs options stored in # variables@@ -61,7 +60,7 @@ test "${PIPESTATUS[0]}" -eq 0 || _fail "mkfs failed!" # if the default agcount is too small, bump it up and re-mkfs before testing if [ $agcount -lt 8 ]; then agcount=8 - _scratch_mkfs_xfs -dagcount=$agcount >/dev/null 2>&1 \ + _try_scratch_mkfs_xfs -dagcount=$agcount >/dev/null 2>&1 \ || _notrun "Test requires at least 8 AGs." fi@@ -69,8 +68,7 @@ _dd_repair_check $SCRATCH_DEV $sectsz # smaller AGCOUNT let "agcount=$agcount-2" -_scratch_mkfs_xfs -dagcount=$agcount >/dev/null 2>&1 \ - || _fail "mkfs failed!" +_scratch_mkfs_xfs -dagcount=$agcount >/dev/null 2>&1 _dd_repair_check $SCRATCH_DEV $sectsztests/xfs/181 +1
-2@@ -32,8 +32,7 @@ rm -f $tmp.log _require_scratch echo "mkfs" -_scratch_mkfs_xfs >>$seqres.full 2>&1 \ - || _fail "mkfs scratch failed" +_scratch_mkfs_xfs >>$seqres.full 2>&1 echo "mount" _scratch_mounttests/xfs/183 +1
-2@@ -18,8 +18,7 @@ _begin_fstest rw other auto quick # Setup Filesystem _require_scratch -_scratch_mkfs_xfs >/dev/null 2>&1 \ - || _fail "mkfs failed" +_scratch_mkfs_xfs >/dev/null 2>&1 _scratch_mounttests/xfs/202 +1
-2@@ -24,8 +24,7 @@ _require_scratch_nocheck # a single AG filesystem. # echo "== Creating single-AG filesystem ==" -_scratch_mkfs_xfs -d agcount=1 -d size=$((1024*1024*1024)) >/dev/null 2>&1 \ - || _fail "!!! failed to make filesystem with single AG" +_scratch_mkfs_xfs -d agcount=1 -d size=$((1024*1024*1024)) >/dev/null 2>&1 echo "== Trying to repair it (should fail) ==" _scratch_xfs_repairtests/xfs/244 +2
-2@@ -29,7 +29,7 @@ _require_projid16bit export MOUNT_OPTIONS="-opquota" # make fs with no projid32bit -_scratch_mkfs_xfs -i projid32bit=0 >> $seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs -i projid32bit=0 >> $seqres.full _qmount # make sure project quota is supported _require_prjquota ${SCRATCH_DEV}@@ -73,7 +73,7 @@ fi # Do testing on filesystem with projid32bit feature enabled _scratch_unmount 2>/dev/null -_scratch_mkfs_xfs -i projid32bit=1 >> $seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs -i projid32bit=1 >> $seqres.full _qmount mkdir $dirtests/xfs/266 +1
-1@@ -55,7 +55,7 @@ if [ $? -ne 0 ]; then _notrun "requires xfsdump -D" fi -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_fill # ensure file/dir timestamps precede dump timestamptests/xfs/267 +1
-1@@ -46,7 +46,7 @@ End-of-File _require_tape $TAPE_DEV _require_attrs trusted _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_filestests/xfs/268 +1
-1@@ -49,7 +49,7 @@ End-of-File _require_tape $TAPE_DEV _require_attrs trusted user _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_filestests/xfs/281 +1
-1@@ -22,7 +22,7 @@ _cleanup() _require_legacy_v2_format _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_filltests/xfs/282 +1
-1@@ -24,7 +24,7 @@ _cleanup() _require_legacy_v2_format _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_filltests/xfs/283 +1
-1@@ -24,7 +24,7 @@ _cleanup() _require_legacy_v2_format _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount _create_dumpdir_filltests/xfs/287 +1
-2@@ -35,8 +35,7 @@ _require_projid32bit _require_projid16bit # create xfs fs without projid32bit ability, will be gained by xfs_admin -_scratch_mkfs_xfs -i projid32bit=0 -d size=200m >> $seqres.full \ - || _fail "mkfs failed" +_scratch_mkfs_xfs -i projid32bit=0 -d size=200m >> $seqres.full _qmount_option "pquota" _qmount # require project quotastests/xfs/296 +1
-1@@ -26,7 +26,7 @@ _cleanup() _require_scratch _require_command "$SETCAP_PROG" setcap _require_command "$GETCAP_PROG" getcap -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount mkdir -p $dump_dirtests/xfs/300 +1
-2@@ -20,8 +20,7 @@ _require_xfs_nocrc getenforce | grep -q "Enforcing\|Permissive" || _notrun "SELinux not enabled" [ "$XFS_FSR_PROG" = "" ] && _notrun "xfs_fsr not found" -_scratch_mkfs_xfs -m crc=0 -i size=256 >> $seqres.full 2>&1 \ - || _fail "mkfs failed" +_scratch_mkfs_xfs -m crc=0 -i size=256 >> $seqres.full 2>&1 # Manually mount to avoid fs-wide context set by default in xfstests mount $SCRATCH_DEV $SCRATCH_MNTtests/xfs/301 +1
-1@@ -25,7 +25,7 @@ _cleanup() # Modify as appropriate. _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount # Extended attributestests/xfs/302 +1
-1@@ -24,7 +24,7 @@ _cleanup() # Modify as appropriate. _require_scratch -_scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed" +_scratch_mkfs_xfs >>$seqres.full _scratch_mount echo "Silence is golden."tests/xfs/306 +1
-2@@ -30,8 +30,7 @@ unset SCRATCH_RTDEV # Create a small fs with a large directory block size. We want to fill up the fs # quickly and then create multi-fsb dirblocks over fragmented free space. -_scratch_mkfs_xfs -d size=100m -n size=64k >> $seqres.full 2>&1 || \ - _notrun 'could not format tiny scratch fs' +_scratch_mkfs_xfs -d size=100m -n size=64k >> $seqres.full 2>&1 _scratch_mount # Fill a source directory with many largish-named files. 1k uuid-named entriestests/xfs/445 +1
-2@@ -45,8 +45,7 @@ _check_filestreams_support || _notrun "filestreams not available" unset SCRATCH_RTDEV # use small AGs for frequent stream switching -_scratch_mkfs_xfs -d agsize=20m,size=2g >> $seqres.full 2>&1 || - _fail "mkfs failed" +_scratch_mkfs_xfs -d agsize=20m,size=2g >> $seqres.full 2>&1 _scratch_mount "-o filestreams" # start background inode reclaimtests/xfs/448 +0
-1@@ -33,7 +33,6 @@ rm -f "$seqres.full" # Format and mount _scratch_mkfs | _filter_mkfs > $seqres.full 2> $tmp.mkfs -test "${PIPESTATUS[0]}" -eq 0 || _fail "mkfs failed" _scratch_mount # Get directory block sizetests/xfs/520 +1
-1@@ -34,7 +34,7 @@ _require_scratch_nocheck unset USE_EXTERNAL force_crafted_metadata() { - _scratch_mkfs_xfs -f $fsdsopt "$4" >> $seqres.full 2>&1 || _fail "mkfs failed" + _scratch_mkfs_xfs -f $fsdsopt "$4" >> $seqres.full 2>&1 _scratch_xfs_set_metadata_field "$1" "$2" "$3" >> $seqres.full 2>&1 local kmsg="xfs/$seq: testing $1=$2 at $(date +"%F %T")" local mounted=0tests/xfs/596 +0
-1@@ -39,7 +39,6 @@ _do_die_on_error=message_only rtsize=32 echo -n "Make $rtsize megabyte rt filesystem on SCRATCH_DEV and mount... " _scratch_mkfs_xfs -rsize=${rtsize}m | _filter_mkfs 2> "$tmp.mkfs" >> $seqres.full -test "${PIPESTATUS[0]}" -eq 0 || _fail "mkfs failed" . $tmp.mkfs onemeginblocks=`expr 1048576 / $dbsize`Signature · 1 line
2.43.0
Re: [PATCH 2/4] common: _notrun if _scratch_mkfs_xfs failed
Quoted 2 lines · Zorro Lang
So most of cases (on xfs) will be not changed, only those cases call
_scratch_mkfs_xfsdirectly will be_notrun(if it fails to mkfs before).
Yes.
Quoted 6 lines
I'm still thinking about if this behavior is needed. Last time we just let
_scratch_mkfs_sizedcalls_failif it fails to mkfs. And we hope to get a fail report generally, if a mkfs fails. But now we hope to_notrun? With this patchset, some mkfs failures will cause_fail, but some will cause_notrun. There'll be two kind of behaviors.
Only the ones that have explicit fail code.
But yes, that change is the point of this series - incompatible options will cause mkfs to fail, and the reason for that is that the test case can't work for that configuration. We could try to explicitly catch those cases, but it would be pretty messy. (We actually do that for a bunch of tests, and it doesn't look very nice)
Re: [PATCH 2/4] common: _notrun if _scratch_mkfs_xfs failed
In reply to Christoph HellwigQuoted 10 lines · Christoph Hellwig
If we fail to create a file system with specific passed in options, that that these options conflict with other options $MKFS_OPTIONS. Don't fail the test case for that, but instead
_norunit and display the options that caused it to fail.Add a lower-level
_try_scratch_mkfs_xfshelper for those places that want to check the return value.Signed-off-by Christoph Hellwig <[email protected]>---
[snip]
tests/xfs/178 _dd_repair_check() · line 53
Quoted 7 lines
tests/xfs/178 +0
-0@@ -52,7 +52,6 @@ _dd_repair_check() _require_scratch _scratch_xfs_force_no_metadir
^^^^^
I tried to merge this patch, as it's a xfs particular change, and xfs folks acked it and would like to give it a try.
But this line blocks the merging process. I can't find "_scratch_xfs_force_no_metadir" in xfs/178, and even the whole xfstests. Could you help to rebase this patchset on offical xfstests for-next branch, then send it again? This patch is too big, It's hard for me to merge it manually ( I'm glad to know if there's an easy way to deal with this conflict manually :)
Thanks,
Zorro
Quoted 24 lines
tests/xfs/178 +2
-4_scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs -test "${PIPESTATUS[0]}" -eq 0 || _fail "mkfs failed!" # By executing the followint tmp file, will get on the mkfs options stored in # variables@@ -61,7 +60,7 @@ test "${PIPESTATUS[0]}" -eq 0 || _fail "mkfs failed!" # if the default agcount is too small, bump it up and re-mkfs before testing if [ $agcount -lt 8 ]; then agcount=8 - _scratch_mkfs_xfs -dagcount=$agcount >/dev/null 2>&1 \ + _try_scratch_mkfs_xfs -dagcount=$agcount >/dev/null 2>&1 \ || _notrun "Test requires at least 8 AGs." fi@@ -69,8 +68,7 @@ _dd_repair_check $SCRATCH_DEV $sectsz # smaller AGCOUNT let "agcount=$agcount-2" -_scratch_mkfs_xfs -dagcount=$agcount >/dev/null 2>&1 \ - || _fail "mkfs failed!" +_scratch_mkfs_xfs -dagcount=$agcount >/dev/null 2>&1 _dd_repair_check $SCRATCH_DEV $sectsz
[snip]
Re: [PATCH 2/4] common: _notrun if _scratch_mkfs_xfs failed
Quoted 5 lines · Zorro Lang
But this line blocks the merging process. I can't find "
_scratch_xfs_force_no_metadir" in xfs/178, and even the whole xfstests. Could you help to rebase this patchset on offical xfstests for-next branch, then send it again? This patch is too big, It's hard for me to merge it manually ( I'm glad to know if there's an easy way to deal with this conflict manually :)
Sorry, I've been working off Darrick's queue to include the rt improvements once again. I'll rebase it to your latest tree.
PATCH 3/4 xfs/432: use _scratch_mkfs_xfs
In reply to Christoph HellwigUse _scratch_mkfs_xfs instead of _scratch_mkfs to get _notrun handling for unsupported option combinations.
--- tests/xfs/432 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/xfs/432 +1 -1
@@ -52,7 +52,7 @@ echo "Format and mount" # dablock. 33 dirblocks * 64k mean that we can expand a directory by # 2112k before we have to allocate another da btree block. -_scratch_mkfs -b size=1k -n size=64k > "$seqres.full" 2>&1 +_scratch_mkfs_xfs -b size=1k -n size=64k > "$seqres.full" 2>&1 _scratch_mount >> "$seqres.full" 2>&1 testdir="$SCRATCH_MNT/test-$seq"
Signature · 1 line
2.43.0
PATCH 4/4 xfs/516: use _scratch_mkfs_xfs
In reply to Christoph HellwigUse _scratch_mkfs_xfs instead of _scratch_mkfs to get _notrun handling for unsupported option combinations.
--- tests/xfs/516 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tests/xfs/516 +3 -3
@@ -72,7 +72,7 @@ __test_mount_opts() test_sunit_opts() { echo "Format with 4k stripe unit; 1x stripe width" >> $seqres.full - _scratch_mkfs -b size=4k -d sunit=8,swidth=8 >> $seqres.full 2>&1 + _scratch_mkfs_xfs -b size=4k -d sunit=8,swidth=8 >> $seqres.full 2>&1 __test_mount_opts "$@" }
@@ -82,7 +82,7 @@ test_su_opts() local mounted=0 echo "Format with 256k stripe unit; 4x stripe width" >> $seqres.full - _scratch_mkfs -b size=1k -d su=256k,sw=4 >> $seqres.full 2>&1 + _scratch_mkfs_xfs -b size=1k -d su=256k,sw=4 >> $seqres.full 2>&1 __test_mount_opts "$@" }
@@ -92,7 +92,7 @@ test_repair_detection() local mounted=0 echo "Format with 256k stripe unit; 4x stripe width" >> $seqres.full - _scratch_mkfs -b size=1k -d su=256k,sw=4 >> $seqres.full 2>&1 + _scratch_mkfs_xfs -b size=1k -d su=256k,sw=4 >> $seqres.full 2>&1 # Try to mount the fs with our test options. _try_scratch_mount >> $seqres.full 2>&1 && mounted=1
Signature · 1 line
2.43.0
Quoted 7 lines · Christoph Hellwig
Hi all,
I've been running some tests with forced large log sizes, and forced sector sizes, and get a fair amount of failures because these options collide with options forced by the tests themselves. The series here was my attempt to fix this by not failing the tests in this case but
_notrunthem and print the options that caused them to fail.
Yeah, it's a bit of a mess. It's not been an issue for ext4 because mkfs.ext4 allows options specified later in the command-line to override earlier ones.
Quoted 5 lines
So what could we do instead? We might distinguish better between tests that just want to create a scratch file system with $MKFS_OPTIONS from the xfstests config, and those (file system specific ones) that want to force very specific file system configurations. How do we get there?
There's a third possibility, which is sometimes the test might explicitly want the mkfs options to be merged together. For example, in the ext4/4k configuration we have "-b 4096", while the ext4/1k confiuration option we might have "-b 1024". And we might want to have that *combined* with a test which is enabling fscrypt feature, so we can test fscrypt with a 4k block size, as well as fsvrypt with a 1k blocksize.
That being said, that doesn't always make sense, and sometimes the combination doesn't make any sense.
It's not clear what the best solution should be.
- Ted
Quoted 3 lines · Theodore Ts'o
Yeah, it's a bit of a mess. It's not been an issue for ext4 because mkfs.ext4 allows options specified later in the command-line to override earlier ones.
At least in my case it's not really by overriding. E.g. if I force an allocation group (or block group in extN terms) to a specific size and then want a log that is larger than that, changing the AG size is generally a bad idea, and a clear warning to the user is simply the better interface.
Quoted 10 lines
There's a third possibility, which is sometimes the test might explicitly want the mkfs options to be merged together. For example, in the ext4/4k configuration we have "-b 4096", while the ext4/1k confiuration option we might have "-b 1024". And we might want to have that *combined* with a test which is enabling fscrypt feature, so we can test fscrypt with a 4k block size, as well as fsvrypt with a 1k blocksize.
That being said, that doesn't always make sense, and sometimes the combination doesn't make any sense.
Merging the options is what we're currently doing, and it works ok most of the time. The question is what to do when it doesn't.
Quoted 6 lines · Christoph Hellwig
At least in my case it's not really by overriding. E.g. if I force an allocation group (or block group in extN terms) to a specific size and then want a log that is larger than that, changing the AG size is generally a bad idea, and a clear warning to the user is simply the better interface.
Is it just "a bad idea", or "it won't work"? I can imagine that sometimes we want to have tests that do things that are generally a bad idea, but it's the best way to force a particular corner case to happen without having to run the test gazillions of times?
I do remember some cases where when we were using a 1k block size, the test wouldn't actually work because the file system needed to be bigger or the metadata overhead ended up causing an ENOSPC too early, or something weird like that. So that was a case were the merging would _work_, and in fact was testing a combination that we actually wanted to test --- but we had to adjust the test subtly so it would work both on a 4k block size and a 1k block size. I don't remember which test it was, or we hacked it, but I'm fairly certain it's something we've done before. It's messy.
Quoted 2 lines
Merging the options is what we're currently doing, and it works ok most of the time. The question is what to do when it doesn't.
No matter what, it seems like we'll have to look at each of these tests and treat them on a per-case basis. We could have options which allows the test to specify that it shouldn't be merging; but then we'd still have to decide what we need to do. And what do we do if we don't want to merge for ext4 and xfs, but it would be useful for btrfs (for example) to merge the options. It's probably also going to depend on which test scenarios that various file system developers' test setups choose to use....
- Ted
Quoted 6 lines · Theodore Ts'o
Quoted 4 lines
an allocation group (or block group in extN terms) to a specific size and then want a log that is larger than that, changing the AG size is generally a bad idea, and a clear warning to the user is simply the better interface.
Is it just "a bad idea", or "it won't work"?
Changing the AG size could work (assuming the file system size is big enough, beause if it's not it obviously can't).
Quoted 4 lines
I can imagine that
sometimes we want to have tests that do things that are generally a bad idea, but it's the best way to force a particular corner case to happen without having to run the test gazillions of times?
If the test is written under the assumption of an AG size or number of AGs, the expected output will change. So maybe the could would run, sorta. But it would test something else and the test would always fail.
Quoted 26 lines · Theodore Ts'o
Quoted 6 lines · Christoph Hellwig
At least in my case it's not really by overriding. E.g. if I force an allocation group (or block group in extN terms) to a specific size and then want a log that is larger than that, changing the AG size is generally a bad idea, and a clear warning to the user is simply the better interface.
Is it just "a bad idea", or "it won't work"? I can imagine that sometimes we want to have tests that do things that are generally a bad idea, but it's the best way to force a particular corner case to happen without having to run the test gazillions of times?
I do remember some cases where when we were using a 1k block size, the test wouldn't actually work because the file system needed to be bigger or the metadata overhead ended up causing an ENOSPC too early, or something weird like that. So that was a case were the merging would _work_, and in fact was testing a combination that we actually wanted to test --- but we had to adjust the test subtly so it would work both on a 4k block size and a 1k block size. I don't remember which test it was, or we hacked it, but I'm fairly certain it's something we've done before. It's messy.
Quoted 2 lines
Merging the options is what we're currently doing, and it works ok most of the time. The question is what to do when it doesn't.
Quoted 8 lines
No matter what, it seems like we'll have to look at each of these tests and treat them on a per-case basis. We could have options which allows the test to specify that it shouldn't be merging; but then we'd still have to decide what we need to do. And what do we do if we don't want to merge for ext4 and xfs, but it would be useful for btrfs (for example) to merge the options. It's probably also going to depend on which test scenarios that various file system developers' test setups choose to use....
The big question I have is: for at least the standard -g all runs, does this decrease the number of tests selected? AFAICT all it does is converts mkfs option parsing _fail into _notrun, but a 35k shell script patch is a lot to take in.
If it doesn't change the number of tests selected to run then I think I'm ok with this.
--D
Quoted 2 lines · Darrick J. Wong
The big question I have is: for at least the standard -g all runs, does this decrease the number of tests selected?
For a -g auto / -g quick run without any extra options it does not change test coverage at all. It only kicks in if you add "problematic" mkfs options.
Darrick J. Wong
Acked-byQuoted 7 lines · Christoph Hellwig
Quoted 2 lines · Darrick J. Wong
The big question I have is: for at least the standard -g all runs, does this decrease the number of tests selected?
For a -g auto / -g quick run without any extra options it does not change test coverage at all. It only kicks in if you add "problematic" mkfs options.
<nod> In that case, I think I'm ok with letting this graduate to for-next to see what happens :)
--D