common/config: export TEST_DEV for mkfs.xfs
PATCH 1/2 common/config: export TEST_DEV for mkfs.xfs
As of xfsprogs commit 6e0ed3d1 ("mkfs: stop allowing tiny filesystems") attempts to create XFS filesystems sized under 300M fail, unless TEST_DIR, TEST_DEV and QA_CHECK_FS environment variables are exported (or a --unsupported mkfs parameter is provided).
TEST_DIR and QA_CHECK_FS are already exported, while TEST_DEV may only be locally set if provided via e.g. configs/$HOSTNAME.config. Explicitly export TEST_DEV to ensure that tests which call _scratch_mkfs_sized() with an fssize under 300M run normally.
--- common/config | 3 +++ 1 file changed, 3 insertions(+)
common/config +3 -0
@@ -932,6 +932,9 @@ else fi _canonicalize_devices +# mkfs.xfs checks for TEST_DEV before permitting < 300M filesystems. TEST_DIR +# and QA_CHECK_FS are also checked by mkfs.xfs, but already exported elsewhere. +export TEST_DEV # make sure this script returns success /bin/true
Signature · 1 line
2.35.3
PATCH 2/2 tests: _fail on _scratch_mkfs_sized failure
If _scratch_mkfs_sized() fails, e.g. due to an FS not supporting the provided size, tests may subsequently mount and run atop a previously created (e.g. non-size-bound) filesystem.
This can lead to difficult to debug failures, or for some -ENOSPC exercising tests, near infinite runtimes. Avoid this by exiting immediately if _scratch_mkfs_sized() fails.
--- tests/btrfs/057 | 3 ++- tests/btrfs/132 | 3 ++- tests/btrfs/170 | 2 +- tests/btrfs/177 | 2 +- tests/btrfs/204 | 2 +- tests/btrfs/217 | 3 ++- tests/btrfs/237 | 1 + tests/btrfs/250 | 2 +- tests/btrfs/253 | 3 ++- tests/ext4/004 | 3 ++- tests/ext4/036 | 2 +- tests/ext4/038 | 3 ++- tests/ext4/039 | 3 ++- tests/ext4/048 | 3 ++- tests/ext4/050 | 3 ++- tests/ext4/271 | 3 ++- tests/ext4/307 | 3 ++- tests/f2fs/001 | 3 ++- tests/generic/027 | 3 ++- tests/generic/081 | 3 ++- tests/generic/085 | 2 +- tests/generic/096 | 3 ++- tests/generic/102 | 2 +- tests/generic/204 | 2 +- tests/generic/224 | 3 ++- tests/generic/226 | 3 ++- tests/generic/250 | 2 +- tests/generic/252 | 2 +- tests/generic/256 | 3 ++- tests/generic/269 | 3 ++- tests/generic/270 | 3 ++- tests/generic/273 | 3 ++- tests/generic/274 | 3 ++- tests/generic/275 | 3 ++- tests/generic/300 | 2 +- tests/generic/312 | 2 +- tests/generic/320 | 2 +- tests/generic/333 | 3 ++- tests/generic/334 | 3 ++- tests/generic/361 | 3 ++- tests/generic/371 | 3 ++- tests/generic/387 | 3 ++- tests/generic/399 | 2 +- tests/generic/416 | 2 +- tests/generic/427 | 3 ++- tests/generic/449 | 3 ++- tests/generic/459 | 3 ++- tests/generic/488 | 3 ++- tests/generic/511 | 3 ++- tests/generic/515 | 3 ++- tests/generic/520 | 2 +- tests/generic/536 | 3 ++- tests/generic/546 | 3 ++- tests/generic/558 | 3 ++- tests/generic/559 | 2 +- tests/generic/562 | 3 ++- tests/generic/619 | 2 +- tests/generic/626 | 3 ++- tests/generic/679 | 3 ++- tests/xfs/075 | 2 +- tests/xfs/107 | 3 ++- tests/xfs/118 | 3 ++- tests/xfs/127 | 3 ++- tests/xfs/227 | 3 ++- tests/xfs/233 | 3 ++- tests/xfs/442 | 3 ++- tests/xfs/529 | 3 ++- tests/xfs/532 | 3 ++- tests/xfs/534 | 3 ++- tests/xfs/535 | 3 ++- tests/xfs/538 | 3 ++- 71 files changed, 122 insertions(+), 70 deletions(-)
tests/btrfs/057 +2 -1
@@ -17,7 +17,8 @@ _supported_fs btrfs _require_scratch _require_qgroup_rescan -_scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount
tests/btrfs/132 +2 -1
@@ -35,7 +35,8 @@ _require_scratch # to further increase the possibility # Since the false ENOSPC happens due to incorrect metadata reservation, # larger nodesize and small fs will make it much easier to reproduce -_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" # Recommended to use MOUNT_OPTIONS="-o compress" to trigger the bug _scratch_mount
tests/btrfs/170 +1 -1
@@ -25,7 +25,7 @@ _require_xfs_io_command "falloc" "-k" # later want to not have more space available for allocating data extents but # still have enough metadata space free for creating the snapshot. fs_size=$((2 * 1024 * 1024 * 1024)) # 2Gb -_scratch_mkfs_sized $fs_size >>$seqres.full 2>&1 +_scratch_mkfs_sized $fs_size >>$seqres.full 2>&1 || _fail "mkfs failed" # Mount without space cache so that we can precisely fill all data space and # unallocated space later (space cache v1 uses data block groups).
tests/btrfs/177 +1 -1
@@ -47,7 +47,7 @@ _require_scratch_size $((3 * 1024 * 1024)) #kB # First, create a 1GB filesystem. fssize=$((1024 * 1024 * 1024)) -_scratch_mkfs_sized $fssize >> $seqres.full 2>&1 +_scratch_mkfs_sized $fssize >> $seqres.full 2>&1 || _fail "mkfs failed" _scratch_mount # Create a small file and run balance so we shall deal with the chunk
tests/btrfs/204 +1 -1
@@ -20,7 +20,7 @@ _supported_fs btrfs _require_scratch _require_xfs_io_command "fpunch" -_scratch_mkfs_sized $((256 * 1024 *1024)) >> $seqres.full +_scratch_mkfs_sized $((256 * 1024 *1024)) >> $seqres.full || _fail "mkfs failed" # max_inline ensures data is not inlined within metadata extents _scratch_mount "-o max_inline=0,nodatacow"
tests/btrfs/217 +2 -1
@@ -23,7 +23,8 @@ _require_scratch_size $((5 * 1024 * 1024)) #kB _require_fstrim # Create a 5G fs -_scratch_mkfs_sized $((5 * 1024 * 1024 * 1024)) >> $seqres.full +_scratch_mkfs_sized $((5 * 1024 * 1024 * 1024)) >> $seqres.full \ + || _fail "mkfs failed" _scratch_mount # Fstrim to populate the device->alloc_status CHUNK_TRIMMED bits
tests/btrfs/237 +1 -0
@@ -53,6 +53,7 @@ if [[ $devsize -gt $fssize ]]; then else _scratch_mkfs >> $seqres.full 2>&1 fi +[[ $? -ne 0 ]] && _fail "mkfs failed" _scratch_mount -o commit=1 # 1s commit time to speed up test uuid=$($BTRFS_UTIL_PROG filesystem show $SCRATCH_DEV |grep uuid: |\
tests/btrfs/250 +1 -1
@@ -36,7 +36,7 @@ _require_odirect # space available for allocating data extents but still have enough metadata # space free for the file writes. fs_size=$((1024 * 1024 * 1024)) # 1G -_scratch_mkfs_sized $fs_size >>$seqres.full 2>&1 +_scratch_mkfs_sized $fs_size >>$seqres.full 2>&1 || _fail "mkfs failed" _scratch_mount # Create our test file with the NOCOW attribute set.
tests/btrfs/253 +2 -1
@@ -89,7 +89,8 @@ rm -f "${seqres}.full" # Make filesystem. 10GB is needed to test different chunk sizes for # metadata and data and the default size for volumes > 5GB is different. -_scratch_mkfs_sized $((10 * 1024 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((10 * 1024 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount >> $seqres.full 2>&1 # Check if there is sufficient sysfs support.
tests/ext4/004 +2 -1
@@ -54,7 +54,8 @@ _require_command "$RESTORE_PROG" restore echo "Silence is golden" -_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount rm -rf $restore_dir $TEST_DIR/restoresymtable
tests/ext4/036 +1 -1
@@ -21,7 +21,7 @@ _require_scratch echo "Silence is golden" -_scratch_mkfs_sized $((16*1024*1024)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((16*1024*1024)) >>$seqres.full 2>&1 || _fail "mkfs failed" _scratch_mount # create a file and get its inode number, usually it's 12, but to be accurate
tests/ext4/038 +2 -1
@@ -23,7 +23,8 @@ echo "Silence is golden" # it is better to test all reserved inode numbers 1-10 here for i in {1..10}; do # create smaller filesystems to save test time - _scratch_mkfs_sized $((16 * 1024 * 1024)) >>$seqres.full 2>&1 + _scratch_mkfs_sized $((16 * 1024 * 1024)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" $DEBUGFS_PROG -w -R "ssv last_orphan $i" $SCRATCH_DEV >>$seqres.full 2>&1 _scratch_mount _scratch_unmount
tests/ext4/039 +2 -1
@@ -61,7 +61,8 @@ _supported_fs ext3 ext4 _require_scratch _exclude_scratch_mount_option dax -_scratch_mkfs_sized $((64 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((64 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount if ! _workout; then
tests/ext4/048 +2 -1
@@ -81,7 +81,8 @@ test_file1="test0001" test_file2="test0002" test_file3="test0003" -_scratch_mkfs_sized $((128 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((128 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" # create scratch dir for testing # create some files with no name a substr of another name so we can grep later
tests/ext4/050 +2 -1
@@ -24,7 +24,8 @@ _require_test_program "checkpoint_journal" testdir="${SCRATCH_MNT}/testdir" -_scratch_mkfs_sized $((64 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((64 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _require_metadata_journaling $SCRATCH_DEV _scratch_mount >> $seqres.full 2>&1 blocksize=$(_get_block_size $SCRATCH_MNT)
tests/ext4/271 +2 -1
@@ -20,7 +20,8 @@ _require_scratch _exclude_scratch_mount_option "data" "commit" "journal_checksum" \ "journal_async_commit" -_scratch_mkfs_sized $((128 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((128 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" # -onoload and EXT4_SYNC_FL on file is important becase result in # metadata sync writes inside ext4_handle_dirty_metadata()
tests/ext4/307 +2 -1
@@ -41,7 +41,8 @@ _require_scratch _require_defrag _require_xfs_io_command "falloc" -_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount _workout
tests/f2fs/001 +2 -1
@@ -29,7 +29,8 @@ testfile=$SCRATCH_MNT/testfile dummyfile=$SCRATCH_MNT/dummyfile # build 4GB filesystem -_scratch_mkfs_sized $((4 * 1024 * 1024 * 1024)) > /dev/null 2>&1 +_scratch_mkfs_sized $((4 * 1024 * 1024 * 1024)) > /dev/null 2>&1 \ + || _fail "mkfs failed" _scratch_mount echo "==== create small file ===="
tests/generic/027 +2 -1
@@ -35,7 +35,8 @@ _require_scratch echo "Silence is golden" -_scratch_mkfs_sized $((256 * 1024 * 1024)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((256 * 1024 * 1024)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount echo "Reserve 2M space" >>$seqres.full
tests/generic/081 +2 -1
@@ -67,7 +67,8 @@ lvsize=$((size * 85 / 100)) # ~256M # make sure there's enough disk space for 256M lv, test for 300M here in case # lvm uses some space for metadata -_scratch_mkfs_sized $((size * 1024 * 1024)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((size * 1024 * 1024)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" $LVM_PROG vgcreate -f $vgname $SCRATCH_DEV >>$seqres.full 2>&1 # We use yes pipe instead of 'lvcreate --yes' because old version of lvm # (like 2.02.95 in RHEL6) don't support --yes option
tests/generic/085 +1 -1
@@ -52,7 +52,7 @@ echo "Silence is golden" size=$((256 * 1024 * 1024)) size_in_sector=$((size / 512)) -_scratch_mkfs_sized $size >>$seqres.full 2>&1 +_scratch_mkfs_sized $size >>$seqres.full 2>&1 || _fail "mkfs failed" node=$seq-test lvdev=/dev/mapper/$node
tests/generic/096 +2 -1
@@ -23,7 +23,8 @@ _require_xfs_io_command "fzero" echo "Silence is golden" # Use smaller scratch fs to shorten the test time -_scratch_mkfs_sized $((512 * 1024 * 1024)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((512 * 1024 * 1024)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount testfile=$SCRATCH_MNT/$seq.$$
tests/generic/102 +1 -1
@@ -23,7 +23,7 @@ _supported_fs generic _require_scratch dev_size=$((1024 * 1024 * 1024)) # 1GB filesystem -_scratch_mkfs_sized $dev_size >>$seqres.full 2>&1 +_scratch_mkfs_sized $dev_size >>$seqres.full 2>&1 || _fail "mkfs failed" _scratch_mount for ((i = 0; i < 10; i++)); do
tests/generic/204 +1 -1
@@ -31,7 +31,7 @@ _require_scratch [ $FSTYP = "xfs" ] && MKFS_OPTIONS="$MKFS_OPTIONS -l size=16m -i maxpct=50" SIZE=`expr 115 \* 1024 \* 1024` -_scratch_mkfs_sized $SIZE 2> /dev/null > $tmp.mkfs.raw +_scratch_mkfs_sized $SIZE 2> /dev/null > $tmp.mkfs.raw || _fail "mkfs failed" cat $tmp.mkfs.raw | _filter_mkfs 2> $tmp.mkfs > /dev/null _scratch_mount
tests/generic/224 +2 -1
@@ -30,7 +30,8 @@ _supported_fs generic _require_scratch # make a 1GB filesystem -_scratch_mkfs_sized `expr 1024 \* 1024 \* 1024` > $seqres.full 2>&1 +_scratch_mkfs_sized `expr 1024 \* 1024 \* 1024` > $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount >> $seqres.full 2>&1 # set the reserved block pool to almost empty for XFS
tests/generic/226 +2 -1
@@ -19,7 +19,8 @@ _require_odirect _scratch_unmount 2>/dev/null echo "--> mkfs 256m filesystem" -_scratch_mkfs_sized `expr 256 \* 1024 \* 1024` >> $seqres.full 2>&1 +_scratch_mkfs_sized `expr 256 \* 1024 \* 1024` >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount loops=16
tests/generic/250 +1 -1
@@ -35,7 +35,7 @@ unset SCRATCH_RTDEV fssize=$((196 * 1048576)) echo "Format and mount" $XFS_IO_PROG -d -c "pwrite -S 0x69 -b 1048576 0 $fssize" $SCRATCH_DEV >> $seqres.full -_scratch_mkfs_sized $fssize > $seqres.full 2>&1 +_scratch_mkfs_sized $fssize > $seqres.full 2>&1 || _fail "mkfs failed" _dmerror_init _dmerror_mount >> $seqres.full 2>&1 _dmerror_unmount
tests/generic/252 +1 -1
@@ -36,7 +36,7 @@ unset SCRATCH_RTDEV fssize=$((196 * 1048576)) echo "Format and mount" $XFS_IO_PROG -d -c "pwrite -S 0x69 -b 1048576 0 $fssize" $SCRATCH_DEV >> $seqres.full -_scratch_mkfs_sized $fssize > $seqres.full 2>&1 +_scratch_mkfs_sized $fssize > $seqres.full 2>&1 || _fail "mkfs failed" _dmerror_init _dmerror_mount >> $seqres.full 2>&1 _dmerror_unmount
tests/generic/256 +2 -1
@@ -89,7 +89,8 @@ _test_full_fs_punch() # Make a small file system to fill _scratch_unmount &> /dev/null -_scratch_mkfs_sized $(( 1536 * 1024 * 1024 )) &> /dev/null +_scratch_mkfs_sized $(( 1536 * 1024 * 1024 )) &> /dev/null \ + || _fail "mkfs failed" _scratch_mount # Test must be able to write files with non-root permissions chmod 777 $SCRATCH_MNT
tests/generic/269 +2 -1
@@ -42,7 +42,8 @@ _workout() _supported_fs generic _require_scratch -_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount if ! _workout; then
tests/generic/270 +2 -1
@@ -61,7 +61,8 @@ _require_command "$KILLALL_PROG" killall _require_command "$SETCAP_PROG" setcap _require_attrs security -_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount "-o usrquota,grpquota" chmod 777 $SCRATCH_MNT quotacheck -u -g $SCRATCH_MNT 2>/dev/null
tests/generic/273 +2 -1
@@ -125,7 +125,8 @@ echo "start the workload" echo "------------------------------" _scratch_unmount 2>/dev/null -_scratch_mkfs_sized $((2 * 1024 * 1024 * 1024)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((2 * 1024 * 1024 * 1024)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount _do_workload
tests/generic/274 +2 -1
@@ -39,7 +39,8 @@ echo "preallocation test" echo "------------------------------" _scratch_unmount 2>/dev/null -_scratch_mkfs_sized $((2 * 1024 * 1024 * 1024)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((2 * 1024 * 1024 * 1024)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount # Create a 4k file and Allocate 4M past EOF on that file
tests/generic/275 +2 -1
@@ -34,7 +34,8 @@ echo "write until ENOSPC test" echo "------------------------------" _scratch_unmount 2>/dev/null -_scratch_mkfs_sized $((2 * 1024 * 1024 * 1024)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((2 * 1024 * 1024 * 1024)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount # Certain filesystems such as XFS require sufficient free blocks to handle the
tests/generic/300 +1 -1
@@ -110,7 +110,7 @@ EOF _require_fio $fio_config -_scratch_mkfs_sized $FS_SIZE >> $seqres.full 2>&1 +_scratch_mkfs_sized $FS_SIZE >> $seqres.full 2>&1 || _fail "mkfs failed" _scratch_mount echo ""
tests/generic/312 +1 -1
@@ -23,7 +23,7 @@ _require_scratch # 5G in byte fssize=$((2**30 * 5)) -_scratch_mkfs_sized $fssize >>$seqres.full 2>&1 +_scratch_mkfs_sized $fssize >>$seqres.full 2>&1 || _fail "mkfs failed" _scratch_mount >>$seqres.full 2>&1 echo "Silence is golden"
tests/generic/320 +1 -1
@@ -79,7 +79,7 @@ do_workload() echo "Silence is golden" -_scratch_mkfs_sized $fs_size >>$seqres.full 2>&1 +_scratch_mkfs_sized $fs_size >>$seqres.full 2>&1 || _fail "mkfs failed" _scratch_mount >>$seqres.full 2>&1 do_workload
tests/generic/333 +2 -1
@@ -30,7 +30,8 @@ _require_cp_reflink _require_odirect echo "Format and mount" -_scratch_mkfs_sized $((400 * 1048576)) > $seqres.full 2>&1 +_scratch_mkfs_sized $((400 * 1048576)) > $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount >> $seqres.full 2>&1 testdir=$SCRATCH_MNT/test-$seq
tests/generic/334 +2 -1
@@ -29,7 +29,8 @@ _require_scratch_reflink _require_cp_reflink echo "Format and mount" -_scratch_mkfs_sized $((400 * 1048576)) > $seqres.full 2>&1 +_scratch_mkfs_sized $((400 * 1048576)) > $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount >> $seqres.full 2>&1 testdir=$SCRATCH_MNT/test-$seq
tests/generic/361 +2 -1
@@ -33,7 +33,8 @@ _require_loop _require_sparse_files # create a small filesystem to hold another filesystem image -_scratch_mkfs_sized $((512 * 1024 * 1024)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((512 * 1024 * 1024)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount # create the sparse fs image and mount point
tests/generic/371 +2 -1
@@ -20,7 +20,8 @@ _require_scratch _require_xfs_io_command "falloc" test "$FSTYP" = "xfs" && _require_xfs_io_command "extsize" -_scratch_mkfs_sized $((256 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((256 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount # Disable speculative post-EOF preallocation on XFS, which can grow fast enough
tests/generic/387 +2 -1
@@ -19,7 +19,8 @@ _supported_fs generic _require_scratch_reflink #btrfs needs 256mb to create default blockgroup fs -_scratch_mkfs_sized $((256 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((256 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount testfile=$SCRATCH_MNT/testfile
tests/generic/399 +1 -1
@@ -42,7 +42,7 @@ fs_size_in_mb=64 fs_size=$((fs_size_in_mb * 1024 * 1024)) dd if=/dev/zero of=$SCRATCH_DEV bs=$((1024 * 1024)) \ count=$fs_size_in_mb &>> $seqres.full -_scratch_mkfs_sized_encrypted $fs_size &>> $seqres.full +_scratch_mkfs_sized_encrypted $fs_size &>> $seqres.full || _fail "mkfs failed" _scratch_mount keydesc=$(_generate_session_encryption_key)
tests/generic/416 +1 -1
@@ -28,7 +28,7 @@ page_size=$(_get_page_size) nr_files=$(($fs_size / $page_size)) # Use small fs to make the fill more faster -_scratch_mkfs_sized $fs_size >> $seqres.full 2>&1 +_scratch_mkfs_sized $fs_size >> $seqres.full 2>&1 || _fail "mkfs failed" _scratch_mount
tests/generic/427 +2 -1
@@ -27,7 +27,8 @@ _require_aiodio aio-dio-eof-race _require_no_compress # limit the filesystem size, to save the time of filling filesystem -_scratch_mkfs_sized $((256 * 1024 * 1024)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((256 * 1024 * 1024)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount # try to write more bytes than filesystem size to fill the filesystem,
tests/generic/449 +2 -1
@@ -24,7 +24,8 @@ _require_test _require_acls _require_attrs trusted -_scratch_mkfs_sized $((256 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((256 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount || _fail "mount failed" # This is a test of xattr behavior when we run out of disk space for xattrs,
tests/generic/459 +2 -1
@@ -76,7 +76,8 @@ is_shutdown_or_ro() } # Ensure we have enough disk space -_scratch_mkfs_sized $((350 * 1024 * 1024)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((350 * 1024 * 1024)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" # Create a 200MB dm-thin POOL $LVM_PROG pvcreate -f $SCRATCH_DEV >>$seqres.full 2>&1
tests/generic/488 +2 -1
@@ -16,7 +16,8 @@ _supported_fs generic _require_scratch _require_test_program "multi_open_unlink" -_scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount test_file="$SCRATCH_MNT/$seq"
tests/generic/511 +2 -1
@@ -19,7 +19,8 @@ _require_scratch _require_xfs_io_command "falloc" "-k" _require_xfs_io_command "fzero" -_scratch_mkfs_sized $((1024 * 1024 * 256)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((1024 * 1024 * 256)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount $XFS_IO_PROG -fc "pwrite 0 256m" -c fsync $SCRATCH_MNT/file >>$seqres.full 2>&1
tests/generic/515 +2 -1
@@ -24,7 +24,8 @@ _require_xfs_io_command "falloc" # Fill disk with a well known pattern so that stale data exposure becomes much # more obvious. $XFS_IO_PROG -c "pwrite -S 0x58 -b 1m 0 300m" $SCRATCH_DEV >> $seqres.full -_scratch_mkfs_sized $((300 * 1048576)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((300 * 1048576)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount DONOR1=$SCRATCH_MNT/a
tests/generic/520 +1 -1
@@ -33,7 +33,7 @@ _require_scratch_nocheck _require_dm_target flakey # initialize scratch device -_scratch_mkfs_sized $fssize >> $seqres.full 2>&1 +_scratch_mkfs_sized $fssize >> $seqres.full 2>&1 || _fail "mkfs failed" _require_metadata_journaling $SCRATCH_DEV _init_flakey
tests/generic/536 +2 -1
@@ -21,7 +21,8 @@ _require_scratch _require_scratch_shutdown # create a small fs and initialize free blocks with a unique pattern -_scratch_mkfs_sized $((1024 * 1024 * 100)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((1024 * 1024 * 100)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount $XFS_IO_PROG -f -c "pwrite -S 0xab 0 100m" -c fsync $SCRATCH_MNT/spc \ >> $seqres.full 2>&1
tests/generic/546 +2 -1
@@ -35,7 +35,8 @@ _require_xfs_io_command "falloc" _require_scratch_reflink _require_dm_target flakey -_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _require_metadata_journaling $SCRATCH_DEV _init_flakey _mount_flakey
tests/generic/558 +2 -1
@@ -34,7 +34,8 @@ _require_scratch echo "Silence is golden" -_scratch_mkfs_sized $((1024 * 1024 * 1024)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((1024 * 1024 * 1024)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount i=0
tests/generic/559 +1 -1
@@ -18,7 +18,7 @@ _supported_fs generic _require_scratch_duperemove fssize=$((2 * 1024 * 1024 * 1024)) -_scratch_mkfs_sized $fssize > $seqres.full 2>&1 +_scratch_mkfs_sized $fssize > $seqres.full 2>&1 || _fail "mkfs failed" _scratch_mount >> $seqres.full 2>&1 # fill the fs with a big file has same contents
tests/generic/562 +2 -1
@@ -21,7 +21,8 @@ _require_scratch_reflink _require_test_program "punch-alternating" _require_xfs_io_command "fpunch" -_scratch_mkfs_sized $((512 * 1024 * 1024)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((512 * 1024 * 1024)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount file_size=$(( 200 * 1024 * 1024 )) # 200Mb
tests/generic/619 +1 -1
@@ -132,7 +132,7 @@ run_testcase() for i in $(eval echo "{1..$test_iteration_cnt}"); do # Setup the device - _scratch_mkfs_sized $FS_SIZE >> $seqres.full 2>&1 + _scratch_mkfs_sized $FS_SIZE >> $seqres.full 2>&1 || _fail "mkfs failed" _scratch_mount debug "===== Test: $test_name iteration: $i starts ====="
tests/generic/626 +2 -1
@@ -22,7 +22,8 @@ _supported_fs generic _require_scratch _require_renameat2 whiteout -_scratch_mkfs_sized $((256 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((256 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount # Create lots of files, to help to trigger the bug easily
tests/generic/679 +2 -1
@@ -29,7 +29,8 @@ _supported_fs ^xfs rm -f $seqres.full # Create a 1G filesystem. -_scratch_mkfs_sized $((1024 * 1024 * 1024)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((1024 * 1024 * 1024)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount # Create a file with a size of 600M and two holes, each with a size of 1M and
tests/xfs/075 +1 -1
@@ -22,7 +22,7 @@ _require_scratch _qmount_option "defaults" echo "Silence is golden" -_scratch_mkfs_sized $((512 * 1024 * 1024)) >$seqres.full +_scratch_mkfs_sized $((512 * 1024 * 1024)) >$seqres.full || _fail "mkfs failed" # first ro mount with norecovery _try_scratch_mount "-o ro,norecovery" >>$seqres.full 2>&1 \
tests/xfs/107 +2 -1
@@ -32,7 +32,8 @@ size_mb=256 # reproduce within the first 500KB's worth of ALLOCSP calls, so running up # to 16MB should suffice. $XFS_IO_PROG -d -c "pwrite -S 0x58 -b 8m 0 ${size_mb}m" $SCRATCH_DEV > $seqres.full -MKFS_OPTIONS="-K $MKFS_OPTIONS" _scratch_mkfs_sized $((size_mb * 1048576)) >> $seqres.full +MKFS_OPTIONS="-K $MKFS_OPTIONS" _scratch_mkfs_sized $((size_mb * 1048576)) \ + >> $seqres.full || _fail "mkfs failed" _scratch_mount
tests/xfs/118 +2 -1
@@ -28,7 +28,8 @@ _require_command "$XFS_FSR_PROG" "xfs_fsr" _require_xfs_io_command "falloc" # 50M -_scratch_mkfs_sized $((50 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((50 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount echo "Silence is golden"
tests/xfs/127 +2 -1
@@ -20,7 +20,8 @@ _require_no_large_scratch_dev _require_cp_reflink echo "Format and mount" -_scratch_mkfs_sized $((512 * 1024 * 1024)) > $seqres.full 2>&1 +_scratch_mkfs_sized $((512 * 1024 * 1024)) > $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount >> $seqres.full 2>&1 testdir=$SCRATCH_MNT/test-$seq
tests/xfs/227 +2 -1
@@ -122,7 +122,8 @@ create_target_attr_last() } # use a small filesystem so we can control freespace easily -_scratch_mkfs_sized $((50 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((50 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount fragment_freespace
tests/xfs/233 +2 -1
@@ -18,7 +18,8 @@ _require_xfs_scratch_rmapbt _require_no_large_scratch_dev echo "Format and mount" -_scratch_mkfs_sized $((2 * 4096 * 4096)) > $seqres.full 2>&1 +_scratch_mkfs_sized $((2 * 4096 * 4096)) > $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount >> $seqres.full 2>&1 testdir=$SCRATCH_MNT/test-$seq
tests/xfs/442 +2 -1
@@ -68,7 +68,8 @@ _qmount_option "usrquota,grpquota,prjquota" # operations as delalloc for quota accounting") and ("xfs: call # xfs_qm_dqattach before performing reflink operations") though each of those # tests now have separate faster-running regression tests. -_scratch_mkfs_sized $((1600 * 1048576)) > $seqres.full 2>&1 +_scratch_mkfs_sized $((1600 * 1048576)) > $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount >> $seqres.full 2>&1 nr_cpus=$((LOAD_FACTOR * 4))
tests/xfs/529 +2 -1
@@ -29,7 +29,8 @@ _require_xfs_io_error_injection "reduce_max_iextents" _require_xfs_io_error_injection "bmap_alloc_minlen_extent" echo "Format and mount fs" -_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full +_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full \ + || _fail "mkfs failed" _scratch_mount -o uquota >> $seqres.full # bmap_alloc_minlen_extent only applies to the datadev space allocator, so
tests/xfs/532 +2 -1
@@ -26,7 +26,8 @@ _require_xfs_io_error_injection "reduce_max_iextents" _require_xfs_io_error_injection "bmap_alloc_minlen_extent" echo "Format and mount fs" -_scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full +_scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full \ + || _fail "mkfs failed" _scratch_mount >> $seqres.full # Disable realtime inherit flag (if any) on root directory so that space on data
tests/xfs/534 +2 -1
@@ -22,7 +22,8 @@ _require_xfs_io_command "falloc" _require_xfs_io_error_injection "reduce_max_iextents" echo "Format and mount fs" -_scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full +_scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full \ + || _fail "mkfs failed" _scratch_mount >> $seqres.full bsize=$(_get_file_block_size $SCRATCH_MNT)
tests/xfs/535 +2 -1
@@ -25,7 +25,8 @@ _require_xfs_io_command "funshare" _require_xfs_io_error_injection "reduce_max_iextents" echo "Format and mount fs" -_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full +_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full \ + || _fail "mkfs failed" _scratch_mount >> $seqres.full bsize=$(_get_block_size $SCRATCH_MNT)
tests/xfs/538 +2 -1
@@ -23,7 +23,8 @@ _require_test_program "punch-alternating" _require_xfs_io_error_injection "bmap_alloc_minlen_extent" echo "Format and mount fs" -_scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full +_scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full \ + || _fail "mkfs failed" _scratch_mount >> $seqres.full # Disable realtime inherit flag (if any) on root directory so that space on data
Signature · 1 line
2.35.3
Re: [PATCH 2/2] tests: _fail on _scratch_mkfs_sized failure
Quoted 6 lines · David Disseldorp
If
_scratch_mkfs_sized()fails, e.g. due to an FS not supporting the provided size, tests may subsequently mount and run atop a previously created (e.g. non-size-bound) filesystem.
This can lead to difficult to debug failures, or for some-ENOSPCexercising tests, near infinite runtimes. Avoid this by exiting immediately if_scratch_mkfs_sized()fails.
I wonder, how many tests should keep going if _scratch_mkfs_sized isn't successful? Would it be simpler to make a _try_scratch_mkfs_sized for those callers, and make the main _scratch_mkfs_sized simply do
_scratch_mkfs_sized()
{
_try_scratch_mkfs_sized $* || _fail "_scratch_mkfs_sized failed"
}?
--D
Quoted 1,052 lines
Signed-off-by David Disseldorp <[email protected]>--- tests/btrfs/057 | 3 ++- tests/btrfs/132 | 3 ++- tests/btrfs/170 | 2 +- tests/btrfs/177 | 2 +- tests/btrfs/204 | 2 +- tests/btrfs/217 | 3 ++- tests/btrfs/237 | 1 + tests/btrfs/250 | 2 +- tests/btrfs/253 | 3 ++- tests/ext4/004 | 3 ++- tests/ext4/036 | 2 +- tests/ext4/038 | 3 ++- tests/ext4/039 | 3 ++- tests/ext4/048 | 3 ++- tests/ext4/050 | 3 ++- tests/ext4/271 | 3 ++- tests/ext4/307 | 3 ++- tests/f2fs/001 | 3 ++- tests/generic/027 | 3 ++- tests/generic/081 | 3 ++- tests/generic/085 | 2 +- tests/generic/096 | 3 ++- tests/generic/102 | 2 +- tests/generic/204 | 2 +- tests/generic/224 | 3 ++- tests/generic/226 | 3 ++- tests/generic/250 | 2 +- tests/generic/252 | 2 +- tests/generic/256 | 3 ++- tests/generic/269 | 3 ++- tests/generic/270 | 3 ++- tests/generic/273 | 3 ++- tests/generic/274 | 3 ++- tests/generic/275 | 3 ++- tests/generic/300 | 2 +- tests/generic/312 | 2 +- tests/generic/320 | 2 +- tests/generic/333 | 3 ++- tests/generic/334 | 3 ++- tests/generic/361 | 3 ++- tests/generic/371 | 3 ++- tests/generic/387 | 3 ++- tests/generic/399 | 2 +- tests/generic/416 | 2 +- tests/generic/427 | 3 ++- tests/generic/449 | 3 ++- tests/generic/459 | 3 ++- tests/generic/488 | 3 ++- tests/generic/511 | 3 ++- tests/generic/515 | 3 ++- tests/generic/520 | 2 +- tests/generic/536 | 3 ++- tests/generic/546 | 3 ++- tests/generic/558 | 3 ++- tests/generic/559 | 2 +- tests/generic/562 | 3 ++- tests/generic/619 | 2 +- tests/generic/626 | 3 ++- tests/generic/679 | 3 ++- tests/xfs/075 | 2 +- tests/xfs/107 | 3 ++- tests/xfs/118 | 3 ++- tests/xfs/127 | 3 ++- tests/xfs/227 | 3 ++- tests/xfs/233 | 3 ++- tests/xfs/442 | 3 ++- tests/xfs/529 | 3 ++- tests/xfs/532 | 3 ++- tests/xfs/534 | 3 ++- tests/xfs/535 | 3 ++- tests/xfs/538 | 3 ++- 71 files changed, 122 insertions(+), 70 deletions(-)tests/btrfs/057 +2
-1@@ -17,7 +17,8 @@ _supported_fs btrfs _require_scratch _require_qgroup_rescan -_scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mounttests/btrfs/132 +2
-1@@ -35,7 +35,8 @@ _require_scratch # to further increase the possibility # Since the false ENOSPC happens due to incorrect metadata reservation, # larger nodesize and small fs will make it much easier to reproduce -_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" # Recommended to use MOUNT_OPTIONS="-o compress" to trigger the bug _scratch_mounttests/btrfs/170 +1
-1@@ -25,7 +25,7 @@ _require_xfs_io_command "falloc" "-k" # later want to not have more space available for allocating data extents but # still have enough metadata space free for creating the snapshot. fs_size=$((2 * 1024 * 1024 * 1024)) # 2Gb -_scratch_mkfs_sized $fs_size >>$seqres.full 2>&1 +_scratch_mkfs_sized $fs_size >>$seqres.full 2>&1 || _fail "mkfs failed" # Mount without space cache so that we can precisely fill all data space and # unallocated space later (space cache v1 uses data block groups).tests/btrfs/177 +1
-1@@ -47,7 +47,7 @@ _require_scratch_size $((3 * 1024 * 1024)) #kB # First, create a 1GB filesystem. fssize=$((1024 * 1024 * 1024)) -_scratch_mkfs_sized $fssize >> $seqres.full 2>&1 +_scratch_mkfs_sized $fssize >> $seqres.full 2>&1 || _fail "mkfs failed" _scratch_mount # Create a small file and run balance so we shall deal with the chunktests/btrfs/204 +1
-1@@ -20,7 +20,7 @@ _supported_fs btrfs _require_scratch _require_xfs_io_command "fpunch" -_scratch_mkfs_sized $((256 * 1024 *1024)) >> $seqres.full +_scratch_mkfs_sized $((256 * 1024 *1024)) >> $seqres.full || _fail "mkfs failed" # max_inline ensures data is not inlined within metadata extents _scratch_mount "-o max_inline=0,nodatacow"tests/btrfs/217 +2
-1@@ -23,7 +23,8 @@ _require_scratch_size $((5 * 1024 * 1024)) #kB _require_fstrim # Create a 5G fs -_scratch_mkfs_sized $((5 * 1024 * 1024 * 1024)) >> $seqres.full +_scratch_mkfs_sized $((5 * 1024 * 1024 * 1024)) >> $seqres.full \ + || _fail "mkfs failed" _scratch_mount # Fstrim to populate the device->alloc_status CHUNK_TRIMMED bitstests/btrfs/237 +1
-0@@ -53,6 +53,7 @@ if [[ $devsize -gt $fssize ]]; then else _scratch_mkfs >> $seqres.full 2>&1 fi +[[ $? -ne 0 ]] && _fail "mkfs failed" _scratch_mount -o commit=1 # 1s commit time to speed up test uuid=$($BTRFS_UTIL_PROG filesystem show $SCRATCH_DEV |grep uuid: |\tests/btrfs/250 +1
-1@@ -36,7 +36,7 @@ _require_odirect # space available for allocating data extents but still have enough metadata # space free for the file writes. fs_size=$((1024 * 1024 * 1024)) # 1G -_scratch_mkfs_sized $fs_size >>$seqres.full 2>&1 +_scratch_mkfs_sized $fs_size >>$seqres.full 2>&1 || _fail "mkfs failed" _scratch_mount # Create our test file with the NOCOW attribute set.tests/btrfs/253 +2
-1@@ -89,7 +89,8 @@ rm -f "${seqres}.full" # Make filesystem. 10GB is needed to test different chunk sizes for # metadata and data and the default size for volumes > 5GB is different. -_scratch_mkfs_sized $((10 * 1024 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((10 * 1024 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount >> $seqres.full 2>&1 # Check if there is sufficient sysfs support.tests/ext4/004 +2
-1@@ -54,7 +54,8 @@ _require_command "$RESTORE_PROG" restore echo "Silence is golden" -_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount rm -rf $restore_dir $TEST_DIR/restoresymtabletests/ext4/036 +1
-1@@ -21,7 +21,7 @@ _require_scratch echo "Silence is golden" -_scratch_mkfs_sized $((16*1024*1024)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((16*1024*1024)) >>$seqres.full 2>&1 || _fail "mkfs failed" _scratch_mount # create a file and get its inode number, usually it's 12, but to be accuratetests/ext4/038 +2
-1@@ -23,7 +23,8 @@ echo "Silence is golden" # it is better to test all reserved inode numbers 1-10 here for i in {1..10}; do # create smaller filesystems to save test time - _scratch_mkfs_sized $((16 * 1024 * 1024)) >>$seqres.full 2>&1 + _scratch_mkfs_sized $((16 * 1024 * 1024)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" $DEBUGFS_PROG -w -R "ssv last_orphan $i" $SCRATCH_DEV >>$seqres.full 2>&1 _scratch_mount _scratch_unmounttests/ext4/039 +2
-1@@ -61,7 +61,8 @@ _supported_fs ext3 ext4 _require_scratch _exclude_scratch_mount_option dax -_scratch_mkfs_sized $((64 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((64 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount if ! _workout; thentests/ext4/048 +2
-1@@ -81,7 +81,8 @@ test_file1="test0001" test_file2="test0002" test_file3="test0003" -_scratch_mkfs_sized $((128 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((128 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" # create scratch dir for testing # create some files with no name a substr of another name so we can grep latertests/ext4/050 +2
-1@@ -24,7 +24,8 @@ _require_test_program "checkpoint_journal" testdir="${SCRATCH_MNT}/testdir" -_scratch_mkfs_sized $((64 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((64 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _require_metadata_journaling $SCRATCH_DEV _scratch_mount >> $seqres.full 2>&1 blocksize=$(_get_block_size $SCRATCH_MNT)tests/ext4/271 +2
-1@@ -20,7 +20,8 @@ _require_scratch _exclude_scratch_mount_option "data" "commit" "journal_checksum" \ "journal_async_commit" -_scratch_mkfs_sized $((128 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((128 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" # -onoload and EXT4_SYNC_FL on file is important becase result in # metadata sync writes inside ext4_handle_dirty_metadata()tests/ext4/307 +2
-1@@ -41,7 +41,8 @@ _require_scratch _require_defrag _require_xfs_io_command "falloc" -_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount _workouttests/f2fs/001 +2
-1@@ -29,7 +29,8 @@ testfile=$SCRATCH_MNT/testfile dummyfile=$SCRATCH_MNT/dummyfile # build 4GB filesystem -_scratch_mkfs_sized $((4 * 1024 * 1024 * 1024)) > /dev/null 2>&1 +_scratch_mkfs_sized $((4 * 1024 * 1024 * 1024)) > /dev/null 2>&1 \ + || _fail "mkfs failed" _scratch_mount echo "==== create small file ===="tests/generic/027 +2
-1@@ -35,7 +35,8 @@ _require_scratch echo "Silence is golden" -_scratch_mkfs_sized $((256 * 1024 * 1024)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((256 * 1024 * 1024)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount echo "Reserve 2M space" >>$seqres.fulltests/generic/081 +2
-1@@ -67,7 +67,8 @@ lvsize=$((size * 85 / 100)) # ~256M # make sure there's enough disk space for 256M lv, test for 300M here in case # lvm uses some space for metadata -_scratch_mkfs_sized $((size * 1024 * 1024)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((size * 1024 * 1024)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" $LVM_PROG vgcreate -f $vgname $SCRATCH_DEV >>$seqres.full 2>&1 # We use yes pipe instead of 'lvcreate --yes' because old version of lvm # (like 2.02.95 in RHEL6) don't support --yes optiontests/generic/085 +1
-1@@ -52,7 +52,7 @@ echo "Silence is golden" size=$((256 * 1024 * 1024)) size_in_sector=$((size / 512)) -_scratch_mkfs_sized $size >>$seqres.full 2>&1 +_scratch_mkfs_sized $size >>$seqres.full 2>&1 || _fail "mkfs failed" node=$seq-test lvdev=/dev/mapper/$nodetests/generic/096 +2
-1@@ -23,7 +23,8 @@ _require_xfs_io_command "fzero" echo "Silence is golden" # Use smaller scratch fs to shorten the test time -_scratch_mkfs_sized $((512 * 1024 * 1024)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((512 * 1024 * 1024)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount testfile=$SCRATCH_MNT/$seq.$$tests/generic/102 +1
-1@@ -23,7 +23,7 @@ _supported_fs generic _require_scratch dev_size=$((1024 * 1024 * 1024)) # 1GB filesystem -_scratch_mkfs_sized $dev_size >>$seqres.full 2>&1 +_scratch_mkfs_sized $dev_size >>$seqres.full 2>&1 || _fail "mkfs failed" _scratch_mount for ((i = 0; i < 10; i++)); dotests/generic/204 +1
-1@@ -31,7 +31,7 @@ _require_scratch [ $FSTYP = "xfs" ] && MKFS_OPTIONS="$MKFS_OPTIONS -l size=16m -i maxpct=50" SIZE=`expr 115 \* 1024 \* 1024` -_scratch_mkfs_sized $SIZE 2> /dev/null > $tmp.mkfs.raw +_scratch_mkfs_sized $SIZE 2> /dev/null > $tmp.mkfs.raw || _fail "mkfs failed" cat $tmp.mkfs.raw | _filter_mkfs 2> $tmp.mkfs > /dev/null _scratch_mounttests/generic/224 +2
-1@@ -30,7 +30,8 @@ _supported_fs generic _require_scratch # make a 1GB filesystem -_scratch_mkfs_sized `expr 1024 \* 1024 \* 1024` > $seqres.full 2>&1 +_scratch_mkfs_sized `expr 1024 \* 1024 \* 1024` > $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount >> $seqres.full 2>&1 # set the reserved block pool to almost empty for XFStests/generic/226 +2
-1@@ -19,7 +19,8 @@ _require_odirect _scratch_unmount 2>/dev/null echo "--> mkfs 256m filesystem" -_scratch_mkfs_sized `expr 256 \* 1024 \* 1024` >> $seqres.full 2>&1 +_scratch_mkfs_sized `expr 256 \* 1024 \* 1024` >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount loops=16tests/generic/250 +1
-1@@ -35,7 +35,7 @@ unset SCRATCH_RTDEV fssize=$((196 * 1048576)) echo "Format and mount" $XFS_IO_PROG -d -c "pwrite -S 0x69 -b 1048576 0 $fssize" $SCRATCH_DEV >> $seqres.full -_scratch_mkfs_sized $fssize > $seqres.full 2>&1 +_scratch_mkfs_sized $fssize > $seqres.full 2>&1 || _fail "mkfs failed" _dmerror_init _dmerror_mount >> $seqres.full 2>&1 _dmerror_unmounttests/generic/252 +1
-1@@ -36,7 +36,7 @@ unset SCRATCH_RTDEV fssize=$((196 * 1048576)) echo "Format and mount" $XFS_IO_PROG -d -c "pwrite -S 0x69 -b 1048576 0 $fssize" $SCRATCH_DEV >> $seqres.full -_scratch_mkfs_sized $fssize > $seqres.full 2>&1 +_scratch_mkfs_sized $fssize > $seqres.full 2>&1 || _fail "mkfs failed" _dmerror_init _dmerror_mount >> $seqres.full 2>&1 _dmerror_unmounttests/generic/256 +2
-1@@ -89,7 +89,8 @@ _test_full_fs_punch() # Make a small file system to fill _scratch_unmount &> /dev/null -_scratch_mkfs_sized $(( 1536 * 1024 * 1024 )) &> /dev/null +_scratch_mkfs_sized $(( 1536 * 1024 * 1024 )) &> /dev/null \ + || _fail "mkfs failed" _scratch_mount # Test must be able to write files with non-root permissions chmod 777 $SCRATCH_MNTtests/generic/269 +2
-1@@ -42,7 +42,8 @@ _workout() _supported_fs generic _require_scratch -_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount if ! _workout; thentests/generic/270 +2
-1@@ -61,7 +61,8 @@ _require_command "$KILLALL_PROG" killall _require_command "$SETCAP_PROG" setcap _require_attrs security -_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount "-o usrquota,grpquota" chmod 777 $SCRATCH_MNT quotacheck -u -g $SCRATCH_MNT 2>/dev/nulltests/generic/273 +2
-1@@ -125,7 +125,8 @@ echo "start the workload" echo "------------------------------" _scratch_unmount 2>/dev/null -_scratch_mkfs_sized $((2 * 1024 * 1024 * 1024)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((2 * 1024 * 1024 * 1024)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount _do_workloadtests/generic/274 +2
-1@@ -39,7 +39,8 @@ echo "preallocation test" echo "------------------------------" _scratch_unmount 2>/dev/null -_scratch_mkfs_sized $((2 * 1024 * 1024 * 1024)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((2 * 1024 * 1024 * 1024)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount # Create a 4k file and Allocate 4M past EOF on that filetests/generic/275 +2
-1@@ -34,7 +34,8 @@ echo "write until ENOSPC test" echo "------------------------------" _scratch_unmount 2>/dev/null -_scratch_mkfs_sized $((2 * 1024 * 1024 * 1024)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((2 * 1024 * 1024 * 1024)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount # Certain filesystems such as XFS require sufficient free blocks to handle thetests/generic/300 +1
-1@@ -110,7 +110,7 @@ EOF _require_fio $fio_config -_scratch_mkfs_sized $FS_SIZE >> $seqres.full 2>&1 +_scratch_mkfs_sized $FS_SIZE >> $seqres.full 2>&1 || _fail "mkfs failed" _scratch_mount echo ""tests/generic/312 +1
-1@@ -23,7 +23,7 @@ _require_scratch # 5G in byte fssize=$((2**30 * 5)) -_scratch_mkfs_sized $fssize >>$seqres.full 2>&1 +_scratch_mkfs_sized $fssize >>$seqres.full 2>&1 || _fail "mkfs failed" _scratch_mount >>$seqres.full 2>&1 echo "Silence is golden"tests/generic/320 +1
-1@@ -79,7 +79,7 @@ do_workload() echo "Silence is golden" -_scratch_mkfs_sized $fs_size >>$seqres.full 2>&1 +_scratch_mkfs_sized $fs_size >>$seqres.full 2>&1 || _fail "mkfs failed" _scratch_mount >>$seqres.full 2>&1 do_workloadtests/generic/333 +2
-1@@ -30,7 +30,8 @@ _require_cp_reflink _require_odirect echo "Format and mount" -_scratch_mkfs_sized $((400 * 1048576)) > $seqres.full 2>&1 +_scratch_mkfs_sized $((400 * 1048576)) > $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount >> $seqres.full 2>&1 testdir=$SCRATCH_MNT/test-$seqtests/generic/334 +2
-1@@ -29,7 +29,8 @@ _require_scratch_reflink _require_cp_reflink echo "Format and mount" -_scratch_mkfs_sized $((400 * 1048576)) > $seqres.full 2>&1 +_scratch_mkfs_sized $((400 * 1048576)) > $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount >> $seqres.full 2>&1 testdir=$SCRATCH_MNT/test-$seqtests/generic/361 +2
-1@@ -33,7 +33,8 @@ _require_loop _require_sparse_files # create a small filesystem to hold another filesystem image -_scratch_mkfs_sized $((512 * 1024 * 1024)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((512 * 1024 * 1024)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount # create the sparse fs image and mount pointtests/generic/371 +2
-1@@ -20,7 +20,8 @@ _require_scratch _require_xfs_io_command "falloc" test "$FSTYP" = "xfs" && _require_xfs_io_command "extsize" -_scratch_mkfs_sized $((256 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((256 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount # Disable speculative post-EOF preallocation on XFS, which can grow fast enoughtests/generic/387 +2
-1@@ -19,7 +19,8 @@ _supported_fs generic _require_scratch_reflink #btrfs needs 256mb to create default blockgroup fs -_scratch_mkfs_sized $((256 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((256 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount testfile=$SCRATCH_MNT/testfiletests/generic/399 +1
-1@@ -42,7 +42,7 @@ fs_size_in_mb=64 fs_size=$((fs_size_in_mb * 1024 * 1024)) dd if=/dev/zero of=$SCRATCH_DEV bs=$((1024 * 1024)) \ count=$fs_size_in_mb &>> $seqres.full -_scratch_mkfs_sized_encrypted $fs_size &>> $seqres.full +_scratch_mkfs_sized_encrypted $fs_size &>> $seqres.full || _fail "mkfs failed" _scratch_mount keydesc=$(_generate_session_encryption_key)tests/generic/416 +1
-1@@ -28,7 +28,7 @@ page_size=$(_get_page_size) nr_files=$(($fs_size / $page_size)) # Use small fs to make the fill more faster -_scratch_mkfs_sized $fs_size >> $seqres.full 2>&1 +_scratch_mkfs_sized $fs_size >> $seqres.full 2>&1 || _fail "mkfs failed" _scratch_mounttests/generic/427 +2
-1@@ -27,7 +27,8 @@ _require_aiodio aio-dio-eof-race _require_no_compress # limit the filesystem size, to save the time of filling filesystem -_scratch_mkfs_sized $((256 * 1024 * 1024)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((256 * 1024 * 1024)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount # try to write more bytes than filesystem size to fill the filesystem,tests/generic/449 +2
-1@@ -24,7 +24,8 @@ _require_test _require_acls _require_attrs trusted -_scratch_mkfs_sized $((256 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((256 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount || _fail "mount failed" # This is a test of xattr behavior when we run out of disk space for xattrs,tests/generic/459 +2
-1@@ -76,7 +76,8 @@ is_shutdown_or_ro() } # Ensure we have enough disk space -_scratch_mkfs_sized $((350 * 1024 * 1024)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((350 * 1024 * 1024)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" # Create a 200MB dm-thin POOL $LVM_PROG pvcreate -f $SCRATCH_DEV >>$seqres.full 2>&1tests/generic/488 +2
-1@@ -16,7 +16,8 @@ _supported_fs generic _require_scratch _require_test_program "multi_open_unlink" -_scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount test_file="$SCRATCH_MNT/$seq"tests/generic/511 +2
-1@@ -19,7 +19,8 @@ _require_scratch _require_xfs_io_command "falloc" "-k" _require_xfs_io_command "fzero" -_scratch_mkfs_sized $((1024 * 1024 * 256)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((1024 * 1024 * 256)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount $XFS_IO_PROG -fc "pwrite 0 256m" -c fsync $SCRATCH_MNT/file >>$seqres.full 2>&1tests/generic/515 +2
-1@@ -24,7 +24,8 @@ _require_xfs_io_command "falloc" # Fill disk with a well known pattern so that stale data exposure becomes much # more obvious. $XFS_IO_PROG -c "pwrite -S 0x58 -b 1m 0 300m" $SCRATCH_DEV >> $seqres.full -_scratch_mkfs_sized $((300 * 1048576)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((300 * 1048576)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount DONOR1=$SCRATCH_MNT/atests/generic/520 +1
-1@@ -33,7 +33,7 @@ _require_scratch_nocheck _require_dm_target flakey # initialize scratch device -_scratch_mkfs_sized $fssize >> $seqres.full 2>&1 +_scratch_mkfs_sized $fssize >> $seqres.full 2>&1 || _fail "mkfs failed" _require_metadata_journaling $SCRATCH_DEV _init_flakeytests/generic/536 +2
-1@@ -21,7 +21,8 @@ _require_scratch _require_scratch_shutdown # create a small fs and initialize free blocks with a unique pattern -_scratch_mkfs_sized $((1024 * 1024 * 100)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((1024 * 1024 * 100)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount $XFS_IO_PROG -f -c "pwrite -S 0xab 0 100m" -c fsync $SCRATCH_MNT/spc \ >> $seqres.full 2>&1tests/generic/546 +2
-1@@ -35,7 +35,8 @@ _require_xfs_io_command "falloc" _require_scratch_reflink _require_dm_target flakey -_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _require_metadata_journaling $SCRATCH_DEV _init_flakey _mount_flakeytests/generic/558 +2
-1@@ -34,7 +34,8 @@ _require_scratch echo "Silence is golden" -_scratch_mkfs_sized $((1024 * 1024 * 1024)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((1024 * 1024 * 1024)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount i=0tests/generic/559 +1
-1@@ -18,7 +18,7 @@ _supported_fs generic _require_scratch_duperemove fssize=$((2 * 1024 * 1024 * 1024)) -_scratch_mkfs_sized $fssize > $seqres.full 2>&1 +_scratch_mkfs_sized $fssize > $seqres.full 2>&1 || _fail "mkfs failed" _scratch_mount >> $seqres.full 2>&1 # fill the fs with a big file has same contentstests/generic/562 +2
-1@@ -21,7 +21,8 @@ _require_scratch_reflink _require_test_program "punch-alternating" _require_xfs_io_command "fpunch" -_scratch_mkfs_sized $((512 * 1024 * 1024)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((512 * 1024 * 1024)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount file_size=$(( 200 * 1024 * 1024 )) # 200Mbtests/generic/619 +1
-1@@ -132,7 +132,7 @@ run_testcase() for i in $(eval echo "{1..$test_iteration_cnt}"); do # Setup the device - _scratch_mkfs_sized $FS_SIZE >> $seqres.full 2>&1 + _scratch_mkfs_sized $FS_SIZE >> $seqres.full 2>&1 || _fail "mkfs failed" _scratch_mount debug "===== Test: $test_name iteration: $i starts ====="tests/generic/626 +2
-1@@ -22,7 +22,8 @@ _supported_fs generic _require_scratch _require_renameat2 whiteout -_scratch_mkfs_sized $((256 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((256 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount # Create lots of files, to help to trigger the bug easilytests/generic/679 +2
-1@@ -29,7 +29,8 @@ _supported_fs ^xfs rm -f $seqres.full # Create a 1G filesystem. -_scratch_mkfs_sized $((1024 * 1024 * 1024)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((1024 * 1024 * 1024)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount # Create a file with a size of 600M and two holes, each with a size of 1M andtests/xfs/075 +1
-1@@ -22,7 +22,7 @@ _require_scratch _qmount_option "defaults" echo "Silence is golden" -_scratch_mkfs_sized $((512 * 1024 * 1024)) >$seqres.full +_scratch_mkfs_sized $((512 * 1024 * 1024)) >$seqres.full || _fail "mkfs failed" # first ro mount with norecovery _try_scratch_mount "-o ro,norecovery" >>$seqres.full 2>&1 \tests/xfs/107 +2
-1@@ -32,7 +32,8 @@ size_mb=256 # reproduce within the first 500KB's worth of ALLOCSP calls, so running up # to 16MB should suffice. $XFS_IO_PROG -d -c "pwrite -S 0x58 -b 8m 0 ${size_mb}m" $SCRATCH_DEV > $seqres.full -MKFS_OPTIONS="-K $MKFS_OPTIONS" _scratch_mkfs_sized $((size_mb * 1048576)) >> $seqres.full +MKFS_OPTIONS="-K $MKFS_OPTIONS" _scratch_mkfs_sized $((size_mb * 1048576)) \ + >> $seqres.full || _fail "mkfs failed" _scratch_mounttests/xfs/118 +2
-1@@ -28,7 +28,8 @@ _require_command "$XFS_FSR_PROG" "xfs_fsr" _require_xfs_io_command "falloc" # 50M -_scratch_mkfs_sized $((50 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((50 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount echo "Silence is golden"tests/xfs/127 +2
-1@@ -20,7 +20,8 @@ _require_no_large_scratch_dev _require_cp_reflink echo "Format and mount" -_scratch_mkfs_sized $((512 * 1024 * 1024)) > $seqres.full 2>&1 +_scratch_mkfs_sized $((512 * 1024 * 1024)) > $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount >> $seqres.full 2>&1 testdir=$SCRATCH_MNT/test-$seqtests/xfs/227 +2
-1@@ -122,7 +122,8 @@ create_target_attr_last() } # use a small filesystem so we can control freespace easily -_scratch_mkfs_sized $((50 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((50 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount fragment_freespacetests/xfs/233 +2
-1@@ -18,7 +18,8 @@ _require_xfs_scratch_rmapbt _require_no_large_scratch_dev echo "Format and mount" -_scratch_mkfs_sized $((2 * 4096 * 4096)) > $seqres.full 2>&1 +_scratch_mkfs_sized $((2 * 4096 * 4096)) > $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount >> $seqres.full 2>&1 testdir=$SCRATCH_MNT/test-$seqtests/xfs/442 +2
-1@@ -68,7 +68,8 @@ _qmount_option "usrquota,grpquota,prjquota" # operations as delalloc for quota accounting") and ("xfs: call # xfs_qm_dqattach before performing reflink operations") though each of those # tests now have separate faster-running regression tests. -_scratch_mkfs_sized $((1600 * 1048576)) > $seqres.full 2>&1 +_scratch_mkfs_sized $((1600 * 1048576)) > $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount >> $seqres.full 2>&1 nr_cpus=$((LOAD_FACTOR * 4))tests/xfs/529 +2
-1@@ -29,7 +29,8 @@ _require_xfs_io_error_injection "reduce_max_iextents" _require_xfs_io_error_injection "bmap_alloc_minlen_extent" echo "Format and mount fs" -_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full +_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full \ + || _fail "mkfs failed" _scratch_mount -o uquota >> $seqres.full # bmap_alloc_minlen_extent only applies to the datadev space allocator, sotests/xfs/532 +2
-1@@ -26,7 +26,8 @@ _require_xfs_io_error_injection "reduce_max_iextents" _require_xfs_io_error_injection "bmap_alloc_minlen_extent" echo "Format and mount fs" -_scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full +_scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full \ + || _fail "mkfs failed" _scratch_mount >> $seqres.full # Disable realtime inherit flag (if any) on root directory so that space on datatests/xfs/534 +2
-1@@ -22,7 +22,8 @@ _require_xfs_io_command "falloc" _require_xfs_io_error_injection "reduce_max_iextents" echo "Format and mount fs" -_scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full +_scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full \ + || _fail "mkfs failed" _scratch_mount >> $seqres.full bsize=$(_get_file_block_size $SCRATCH_MNT)tests/xfs/535 +2
-1@@ -25,7 +25,8 @@ _require_xfs_io_command "funshare" _require_xfs_io_error_injection "reduce_max_iextents" echo "Format and mount fs" -_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full +_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full \ + || _fail "mkfs failed" _scratch_mount >> $seqres.full bsize=$(_get_block_size $SCRATCH_MNT)tests/xfs/538 +2
-1@@ -23,7 +23,8 @@ _require_test_program "punch-alternating" _require_xfs_io_error_injection "bmap_alloc_minlen_extent" echo "Format and mount fs" -_scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full +_scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full \ + || _fail "mkfs failed" _scratch_mount >> $seqres.full # Disable realtime inherit flag (if any) on root directory so that space on dataSignature · 1 line
2.35.3
Re: [PATCH 2/2] tests: _fail on _scratch_mkfs_sized failure
Quoted 12 lines · Darrick J. Wong
Quoted 6 lines · David Disseldorp
If
_scratch_mkfs_sized()fails, e.g. due to an FS not supporting the provided size, tests may subsequently mount and run atop a previously created (e.g. non-size-bound) filesystem.
This can lead to difficult to debug failures, or for some-ENOSPCexercising tests, near infinite runtimes. Avoid this by exiting immediately if_scratch_mkfs_sized()fails.I wonder, how many tests should keep going if
_scratch_mkfs_sizedisn't successful? Would it be simpler to make a_try_scratch_mkfs_sizedfor those callers, and make the main_scratch_mkfs_sizedsimply do
Quoted 6 lines
_scratch_mkfs_sized(){ _try_scratch_mkfs_sized $* || _fail "_scratch_mkfs_sized failed" }?
I agree with this. Actually I don't know what's kind of historical reasons make _scratch_mount _fail directly if mount fails, but _scratch_mkfs doesn't like that?
Thanks,
Zorro
Quoted 1,056 lines
--D
Quoted 1,052 lines
Signed-off-by David Disseldorp <[email protected]>--- tests/btrfs/057 | 3 ++- tests/btrfs/132 | 3 ++- tests/btrfs/170 | 2 +- tests/btrfs/177 | 2 +- tests/btrfs/204 | 2 +- tests/btrfs/217 | 3 ++- tests/btrfs/237 | 1 + tests/btrfs/250 | 2 +- tests/btrfs/253 | 3 ++- tests/ext4/004 | 3 ++- tests/ext4/036 | 2 +- tests/ext4/038 | 3 ++- tests/ext4/039 | 3 ++- tests/ext4/048 | 3 ++- tests/ext4/050 | 3 ++- tests/ext4/271 | 3 ++- tests/ext4/307 | 3 ++- tests/f2fs/001 | 3 ++- tests/generic/027 | 3 ++- tests/generic/081 | 3 ++- tests/generic/085 | 2 +- tests/generic/096 | 3 ++- tests/generic/102 | 2 +- tests/generic/204 | 2 +- tests/generic/224 | 3 ++- tests/generic/226 | 3 ++- tests/generic/250 | 2 +- tests/generic/252 | 2 +- tests/generic/256 | 3 ++- tests/generic/269 | 3 ++- tests/generic/270 | 3 ++- tests/generic/273 | 3 ++- tests/generic/274 | 3 ++- tests/generic/275 | 3 ++- tests/generic/300 | 2 +- tests/generic/312 | 2 +- tests/generic/320 | 2 +- tests/generic/333 | 3 ++- tests/generic/334 | 3 ++- tests/generic/361 | 3 ++- tests/generic/371 | 3 ++- tests/generic/387 | 3 ++- tests/generic/399 | 2 +- tests/generic/416 | 2 +- tests/generic/427 | 3 ++- tests/generic/449 | 3 ++- tests/generic/459 | 3 ++- tests/generic/488 | 3 ++- tests/generic/511 | 3 ++- tests/generic/515 | 3 ++- tests/generic/520 | 2 +- tests/generic/536 | 3 ++- tests/generic/546 | 3 ++- tests/generic/558 | 3 ++- tests/generic/559 | 2 +- tests/generic/562 | 3 ++- tests/generic/619 | 2 +- tests/generic/626 | 3 ++- tests/generic/679 | 3 ++- tests/xfs/075 | 2 +- tests/xfs/107 | 3 ++- tests/xfs/118 | 3 ++- tests/xfs/127 | 3 ++- tests/xfs/227 | 3 ++- tests/xfs/233 | 3 ++- tests/xfs/442 | 3 ++- tests/xfs/529 | 3 ++- tests/xfs/532 | 3 ++- tests/xfs/534 | 3 ++- tests/xfs/535 | 3 ++- tests/xfs/538 | 3 ++- 71 files changed, 122 insertions(+), 70 deletions(-)tests/btrfs/057 +2
-1@@ -17,7 +17,8 @@ _supported_fs btrfs _require_scratch _require_qgroup_rescan -_scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mounttests/btrfs/132 +2
-1@@ -35,7 +35,8 @@ _require_scratch # to further increase the possibility # Since the false ENOSPC happens due to incorrect metadata reservation, # larger nodesize and small fs will make it much easier to reproduce -_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" # Recommended to use MOUNT_OPTIONS="-o compress" to trigger the bug _scratch_mounttests/btrfs/170 +1
-1@@ -25,7 +25,7 @@ _require_xfs_io_command "falloc" "-k" # later want to not have more space available for allocating data extents but # still have enough metadata space free for creating the snapshot. fs_size=$((2 * 1024 * 1024 * 1024)) # 2Gb -_scratch_mkfs_sized $fs_size >>$seqres.full 2>&1 +_scratch_mkfs_sized $fs_size >>$seqres.full 2>&1 || _fail "mkfs failed" # Mount without space cache so that we can precisely fill all data space and # unallocated space later (space cache v1 uses data block groups).tests/btrfs/177 +1
-1@@ -47,7 +47,7 @@ _require_scratch_size $((3 * 1024 * 1024)) #kB # First, create a 1GB filesystem. fssize=$((1024 * 1024 * 1024)) -_scratch_mkfs_sized $fssize >> $seqres.full 2>&1 +_scratch_mkfs_sized $fssize >> $seqres.full 2>&1 || _fail "mkfs failed" _scratch_mount # Create a small file and run balance so we shall deal with the chunktests/btrfs/204 +1
-1@@ -20,7 +20,7 @@ _supported_fs btrfs _require_scratch _require_xfs_io_command "fpunch" -_scratch_mkfs_sized $((256 * 1024 *1024)) >> $seqres.full +_scratch_mkfs_sized $((256 * 1024 *1024)) >> $seqres.full || _fail "mkfs failed" # max_inline ensures data is not inlined within metadata extents _scratch_mount "-o max_inline=0,nodatacow"tests/btrfs/217 +2
-1@@ -23,7 +23,8 @@ _require_scratch_size $((5 * 1024 * 1024)) #kB _require_fstrim # Create a 5G fs -_scratch_mkfs_sized $((5 * 1024 * 1024 * 1024)) >> $seqres.full +_scratch_mkfs_sized $((5 * 1024 * 1024 * 1024)) >> $seqres.full \ + || _fail "mkfs failed" _scratch_mount # Fstrim to populate the device->alloc_status CHUNK_TRIMMED bitstests/btrfs/237 +1
-0@@ -53,6 +53,7 @@ if [[ $devsize -gt $fssize ]]; then else _scratch_mkfs >> $seqres.full 2>&1 fi +[[ $? -ne 0 ]] && _fail "mkfs failed" _scratch_mount -o commit=1 # 1s commit time to speed up test uuid=$($BTRFS_UTIL_PROG filesystem show $SCRATCH_DEV |grep uuid: |\tests/btrfs/250 +1
-1@@ -36,7 +36,7 @@ _require_odirect # space available for allocating data extents but still have enough metadata # space free for the file writes. fs_size=$((1024 * 1024 * 1024)) # 1G -_scratch_mkfs_sized $fs_size >>$seqres.full 2>&1 +_scratch_mkfs_sized $fs_size >>$seqres.full 2>&1 || _fail "mkfs failed" _scratch_mount # Create our test file with the NOCOW attribute set.tests/btrfs/253 +2
-1@@ -89,7 +89,8 @@ rm -f "${seqres}.full" # Make filesystem. 10GB is needed to test different chunk sizes for # metadata and data and the default size for volumes > 5GB is different. -_scratch_mkfs_sized $((10 * 1024 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((10 * 1024 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount >> $seqres.full 2>&1 # Check if there is sufficient sysfs support.tests/ext4/004 +2
-1@@ -54,7 +54,8 @@ _require_command "$RESTORE_PROG" restore echo "Silence is golden" -_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount rm -rf $restore_dir $TEST_DIR/restoresymtabletests/ext4/036 +1
-1@@ -21,7 +21,7 @@ _require_scratch echo "Silence is golden" -_scratch_mkfs_sized $((16*1024*1024)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((16*1024*1024)) >>$seqres.full 2>&1 || _fail "mkfs failed" _scratch_mount # create a file and get its inode number, usually it's 12, but to be accuratetests/ext4/038 +2
-1@@ -23,7 +23,8 @@ echo "Silence is golden" # it is better to test all reserved inode numbers 1-10 here for i in {1..10}; do # create smaller filesystems to save test time - _scratch_mkfs_sized $((16 * 1024 * 1024)) >>$seqres.full 2>&1 + _scratch_mkfs_sized $((16 * 1024 * 1024)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" $DEBUGFS_PROG -w -R "ssv last_orphan $i" $SCRATCH_DEV >>$seqres.full 2>&1 _scratch_mount _scratch_unmounttests/ext4/039 +2
-1@@ -61,7 +61,8 @@ _supported_fs ext3 ext4 _require_scratch _exclude_scratch_mount_option dax -_scratch_mkfs_sized $((64 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((64 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount if ! _workout; thentests/ext4/048 +2
-1@@ -81,7 +81,8 @@ test_file1="test0001" test_file2="test0002" test_file3="test0003" -_scratch_mkfs_sized $((128 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((128 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" # create scratch dir for testing # create some files with no name a substr of another name so we can grep latertests/ext4/050 +2
-1@@ -24,7 +24,8 @@ _require_test_program "checkpoint_journal" testdir="${SCRATCH_MNT}/testdir" -_scratch_mkfs_sized $((64 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((64 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _require_metadata_journaling $SCRATCH_DEV _scratch_mount >> $seqres.full 2>&1 blocksize=$(_get_block_size $SCRATCH_MNT)tests/ext4/271 +2
-1@@ -20,7 +20,8 @@ _require_scratch _exclude_scratch_mount_option "data" "commit" "journal_checksum" \ "journal_async_commit" -_scratch_mkfs_sized $((128 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((128 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" # -onoload and EXT4_SYNC_FL on file is important becase result in # metadata sync writes inside ext4_handle_dirty_metadata()tests/ext4/307 +2
-1@@ -41,7 +41,8 @@ _require_scratch _require_defrag _require_xfs_io_command "falloc" -_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount _workouttests/f2fs/001 +2
-1@@ -29,7 +29,8 @@ testfile=$SCRATCH_MNT/testfile dummyfile=$SCRATCH_MNT/dummyfile # build 4GB filesystem -_scratch_mkfs_sized $((4 * 1024 * 1024 * 1024)) > /dev/null 2>&1 +_scratch_mkfs_sized $((4 * 1024 * 1024 * 1024)) > /dev/null 2>&1 \ + || _fail "mkfs failed" _scratch_mount echo "==== create small file ===="tests/generic/027 +2
-1@@ -35,7 +35,8 @@ _require_scratch echo "Silence is golden" -_scratch_mkfs_sized $((256 * 1024 * 1024)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((256 * 1024 * 1024)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount echo "Reserve 2M space" >>$seqres.fulltests/generic/081 +2
-1@@ -67,7 +67,8 @@ lvsize=$((size * 85 / 100)) # ~256M # make sure there's enough disk space for 256M lv, test for 300M here in case # lvm uses some space for metadata -_scratch_mkfs_sized $((size * 1024 * 1024)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((size * 1024 * 1024)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" $LVM_PROG vgcreate -f $vgname $SCRATCH_DEV >>$seqres.full 2>&1 # We use yes pipe instead of 'lvcreate --yes' because old version of lvm # (like 2.02.95 in RHEL6) don't support --yes optiontests/generic/085 +1
-1@@ -52,7 +52,7 @@ echo "Silence is golden" size=$((256 * 1024 * 1024)) size_in_sector=$((size / 512)) -_scratch_mkfs_sized $size >>$seqres.full 2>&1 +_scratch_mkfs_sized $size >>$seqres.full 2>&1 || _fail "mkfs failed" node=$seq-test lvdev=/dev/mapper/$nodetests/generic/096 +2
-1@@ -23,7 +23,8 @@ _require_xfs_io_command "fzero" echo "Silence is golden" # Use smaller scratch fs to shorten the test time -_scratch_mkfs_sized $((512 * 1024 * 1024)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((512 * 1024 * 1024)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount testfile=$SCRATCH_MNT/$seq.$$tests/generic/102 +1
-1@@ -23,7 +23,7 @@ _supported_fs generic _require_scratch dev_size=$((1024 * 1024 * 1024)) # 1GB filesystem -_scratch_mkfs_sized $dev_size >>$seqres.full 2>&1 +_scratch_mkfs_sized $dev_size >>$seqres.full 2>&1 || _fail "mkfs failed" _scratch_mount for ((i = 0; i < 10; i++)); dotests/generic/204 +1
-1@@ -31,7 +31,7 @@ _require_scratch [ $FSTYP = "xfs" ] && MKFS_OPTIONS="$MKFS_OPTIONS -l size=16m -i maxpct=50" SIZE=`expr 115 \* 1024 \* 1024` -_scratch_mkfs_sized $SIZE 2> /dev/null > $tmp.mkfs.raw +_scratch_mkfs_sized $SIZE 2> /dev/null > $tmp.mkfs.raw || _fail "mkfs failed" cat $tmp.mkfs.raw | _filter_mkfs 2> $tmp.mkfs > /dev/null _scratch_mounttests/generic/224 +2
-1@@ -30,7 +30,8 @@ _supported_fs generic _require_scratch # make a 1GB filesystem -_scratch_mkfs_sized `expr 1024 \* 1024 \* 1024` > $seqres.full 2>&1 +_scratch_mkfs_sized `expr 1024 \* 1024 \* 1024` > $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount >> $seqres.full 2>&1 # set the reserved block pool to almost empty for XFStests/generic/226 +2
-1@@ -19,7 +19,8 @@ _require_odirect _scratch_unmount 2>/dev/null echo "--> mkfs 256m filesystem" -_scratch_mkfs_sized `expr 256 \* 1024 \* 1024` >> $seqres.full 2>&1 +_scratch_mkfs_sized `expr 256 \* 1024 \* 1024` >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount loops=16tests/generic/250 +1
-1@@ -35,7 +35,7 @@ unset SCRATCH_RTDEV fssize=$((196 * 1048576)) echo "Format and mount" $XFS_IO_PROG -d -c "pwrite -S 0x69 -b 1048576 0 $fssize" $SCRATCH_DEV >> $seqres.full -_scratch_mkfs_sized $fssize > $seqres.full 2>&1 +_scratch_mkfs_sized $fssize > $seqres.full 2>&1 || _fail "mkfs failed" _dmerror_init _dmerror_mount >> $seqres.full 2>&1 _dmerror_unmounttests/generic/252 +1
-1@@ -36,7 +36,7 @@ unset SCRATCH_RTDEV fssize=$((196 * 1048576)) echo "Format and mount" $XFS_IO_PROG -d -c "pwrite -S 0x69 -b 1048576 0 $fssize" $SCRATCH_DEV >> $seqres.full -_scratch_mkfs_sized $fssize > $seqres.full 2>&1 +_scratch_mkfs_sized $fssize > $seqres.full 2>&1 || _fail "mkfs failed" _dmerror_init _dmerror_mount >> $seqres.full 2>&1 _dmerror_unmounttests/generic/256 +2
-1@@ -89,7 +89,8 @@ _test_full_fs_punch() # Make a small file system to fill _scratch_unmount &> /dev/null -_scratch_mkfs_sized $(( 1536 * 1024 * 1024 )) &> /dev/null +_scratch_mkfs_sized $(( 1536 * 1024 * 1024 )) &> /dev/null \ + || _fail "mkfs failed" _scratch_mount # Test must be able to write files with non-root permissions chmod 777 $SCRATCH_MNTtests/generic/269 +2
-1@@ -42,7 +42,8 @@ _workout() _supported_fs generic _require_scratch -_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount if ! _workout; thentests/generic/270 +2
-1@@ -61,7 +61,8 @@ _require_command "$KILLALL_PROG" killall _require_command "$SETCAP_PROG" setcap _require_attrs security -_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount "-o usrquota,grpquota" chmod 777 $SCRATCH_MNT quotacheck -u -g $SCRATCH_MNT 2>/dev/nulltests/generic/273 +2
-1@@ -125,7 +125,8 @@ echo "start the workload" echo "------------------------------" _scratch_unmount 2>/dev/null -_scratch_mkfs_sized $((2 * 1024 * 1024 * 1024)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((2 * 1024 * 1024 * 1024)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount _do_workloadtests/generic/274 +2
-1@@ -39,7 +39,8 @@ echo "preallocation test" echo "------------------------------" _scratch_unmount 2>/dev/null -_scratch_mkfs_sized $((2 * 1024 * 1024 * 1024)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((2 * 1024 * 1024 * 1024)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount # Create a 4k file and Allocate 4M past EOF on that filetests/generic/275 +2
-1@@ -34,7 +34,8 @@ echo "write until ENOSPC test" echo "------------------------------" _scratch_unmount 2>/dev/null -_scratch_mkfs_sized $((2 * 1024 * 1024 * 1024)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((2 * 1024 * 1024 * 1024)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount # Certain filesystems such as XFS require sufficient free blocks to handle thetests/generic/300 +1
-1@@ -110,7 +110,7 @@ EOF _require_fio $fio_config -_scratch_mkfs_sized $FS_SIZE >> $seqres.full 2>&1 +_scratch_mkfs_sized $FS_SIZE >> $seqres.full 2>&1 || _fail "mkfs failed" _scratch_mount echo ""tests/generic/312 +1
-1@@ -23,7 +23,7 @@ _require_scratch # 5G in byte fssize=$((2**30 * 5)) -_scratch_mkfs_sized $fssize >>$seqres.full 2>&1 +_scratch_mkfs_sized $fssize >>$seqres.full 2>&1 || _fail "mkfs failed" _scratch_mount >>$seqres.full 2>&1 echo "Silence is golden"tests/generic/320 +1
-1@@ -79,7 +79,7 @@ do_workload() echo "Silence is golden" -_scratch_mkfs_sized $fs_size >>$seqres.full 2>&1 +_scratch_mkfs_sized $fs_size >>$seqres.full 2>&1 || _fail "mkfs failed" _scratch_mount >>$seqres.full 2>&1 do_workloadtests/generic/333 +2
-1@@ -30,7 +30,8 @@ _require_cp_reflink _require_odirect echo "Format and mount" -_scratch_mkfs_sized $((400 * 1048576)) > $seqres.full 2>&1 +_scratch_mkfs_sized $((400 * 1048576)) > $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount >> $seqres.full 2>&1 testdir=$SCRATCH_MNT/test-$seqtests/generic/334 +2
-1@@ -29,7 +29,8 @@ _require_scratch_reflink _require_cp_reflink echo "Format and mount" -_scratch_mkfs_sized $((400 * 1048576)) > $seqres.full 2>&1 +_scratch_mkfs_sized $((400 * 1048576)) > $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount >> $seqres.full 2>&1 testdir=$SCRATCH_MNT/test-$seqtests/generic/361 +2
-1@@ -33,7 +33,8 @@ _require_loop _require_sparse_files # create a small filesystem to hold another filesystem image -_scratch_mkfs_sized $((512 * 1024 * 1024)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((512 * 1024 * 1024)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount # create the sparse fs image and mount pointtests/generic/371 +2
-1@@ -20,7 +20,8 @@ _require_scratch _require_xfs_io_command "falloc" test "$FSTYP" = "xfs" && _require_xfs_io_command "extsize" -_scratch_mkfs_sized $((256 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((256 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount # Disable speculative post-EOF preallocation on XFS, which can grow fast enoughtests/generic/387 +2
-1@@ -19,7 +19,8 @@ _supported_fs generic _require_scratch_reflink #btrfs needs 256mb to create default blockgroup fs -_scratch_mkfs_sized $((256 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((256 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount testfile=$SCRATCH_MNT/testfiletests/generic/399 +1
-1@@ -42,7 +42,7 @@ fs_size_in_mb=64 fs_size=$((fs_size_in_mb * 1024 * 1024)) dd if=/dev/zero of=$SCRATCH_DEV bs=$((1024 * 1024)) \ count=$fs_size_in_mb &>> $seqres.full -_scratch_mkfs_sized_encrypted $fs_size &>> $seqres.full +_scratch_mkfs_sized_encrypted $fs_size &>> $seqres.full || _fail "mkfs failed" _scratch_mount keydesc=$(_generate_session_encryption_key)tests/generic/416 +1
-1@@ -28,7 +28,7 @@ page_size=$(_get_page_size) nr_files=$(($fs_size / $page_size)) # Use small fs to make the fill more faster -_scratch_mkfs_sized $fs_size >> $seqres.full 2>&1 +_scratch_mkfs_sized $fs_size >> $seqres.full 2>&1 || _fail "mkfs failed" _scratch_mounttests/generic/427 +2
-1@@ -27,7 +27,8 @@ _require_aiodio aio-dio-eof-race _require_no_compress # limit the filesystem size, to save the time of filling filesystem -_scratch_mkfs_sized $((256 * 1024 * 1024)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((256 * 1024 * 1024)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount # try to write more bytes than filesystem size to fill the filesystem,tests/generic/449 +2
-1@@ -24,7 +24,8 @@ _require_test _require_acls _require_attrs trusted -_scratch_mkfs_sized $((256 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((256 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount || _fail "mount failed" # This is a test of xattr behavior when we run out of disk space for xattrs,tests/generic/459 +2
-1@@ -76,7 +76,8 @@ is_shutdown_or_ro() } # Ensure we have enough disk space -_scratch_mkfs_sized $((350 * 1024 * 1024)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((350 * 1024 * 1024)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" # Create a 200MB dm-thin POOL $LVM_PROG pvcreate -f $SCRATCH_DEV >>$seqres.full 2>&1tests/generic/488 +2
-1@@ -16,7 +16,8 @@ _supported_fs generic _require_scratch _require_test_program "multi_open_unlink" -_scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount test_file="$SCRATCH_MNT/$seq"tests/generic/511 +2
-1@@ -19,7 +19,8 @@ _require_scratch _require_xfs_io_command "falloc" "-k" _require_xfs_io_command "fzero" -_scratch_mkfs_sized $((1024 * 1024 * 256)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((1024 * 1024 * 256)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount $XFS_IO_PROG -fc "pwrite 0 256m" -c fsync $SCRATCH_MNT/file >>$seqres.full 2>&1tests/generic/515 +2
-1@@ -24,7 +24,8 @@ _require_xfs_io_command "falloc" # Fill disk with a well known pattern so that stale data exposure becomes much # more obvious. $XFS_IO_PROG -c "pwrite -S 0x58 -b 1m 0 300m" $SCRATCH_DEV >> $seqres.full -_scratch_mkfs_sized $((300 * 1048576)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((300 * 1048576)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount DONOR1=$SCRATCH_MNT/atests/generic/520 +1
-1@@ -33,7 +33,7 @@ _require_scratch_nocheck _require_dm_target flakey # initialize scratch device -_scratch_mkfs_sized $fssize >> $seqres.full 2>&1 +_scratch_mkfs_sized $fssize >> $seqres.full 2>&1 || _fail "mkfs failed" _require_metadata_journaling $SCRATCH_DEV _init_flakeytests/generic/536 +2
-1@@ -21,7 +21,8 @@ _require_scratch _require_scratch_shutdown # create a small fs and initialize free blocks with a unique pattern -_scratch_mkfs_sized $((1024 * 1024 * 100)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((1024 * 1024 * 100)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount $XFS_IO_PROG -f -c "pwrite -S 0xab 0 100m" -c fsync $SCRATCH_MNT/spc \ >> $seqres.full 2>&1tests/generic/546 +2
-1@@ -35,7 +35,8 @@ _require_xfs_io_command "falloc" _require_scratch_reflink _require_dm_target flakey -_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _require_metadata_journaling $SCRATCH_DEV _init_flakey _mount_flakeytests/generic/558 +2
-1@@ -34,7 +34,8 @@ _require_scratch echo "Silence is golden" -_scratch_mkfs_sized $((1024 * 1024 * 1024)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((1024 * 1024 * 1024)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount i=0tests/generic/559 +1
-1@@ -18,7 +18,7 @@ _supported_fs generic _require_scratch_duperemove fssize=$((2 * 1024 * 1024 * 1024)) -_scratch_mkfs_sized $fssize > $seqres.full 2>&1 +_scratch_mkfs_sized $fssize > $seqres.full 2>&1 || _fail "mkfs failed" _scratch_mount >> $seqres.full 2>&1 # fill the fs with a big file has same contentstests/generic/562 +2
-1@@ -21,7 +21,8 @@ _require_scratch_reflink _require_test_program "punch-alternating" _require_xfs_io_command "fpunch" -_scratch_mkfs_sized $((512 * 1024 * 1024)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((512 * 1024 * 1024)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount file_size=$(( 200 * 1024 * 1024 )) # 200Mbtests/generic/619 +1
-1@@ -132,7 +132,7 @@ run_testcase() for i in $(eval echo "{1..$test_iteration_cnt}"); do # Setup the device - _scratch_mkfs_sized $FS_SIZE >> $seqres.full 2>&1 + _scratch_mkfs_sized $FS_SIZE >> $seqres.full 2>&1 || _fail "mkfs failed" _scratch_mount debug "===== Test: $test_name iteration: $i starts ====="tests/generic/626 +2
-1@@ -22,7 +22,8 @@ _supported_fs generic _require_scratch _require_renameat2 whiteout -_scratch_mkfs_sized $((256 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((256 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount # Create lots of files, to help to trigger the bug easilytests/generic/679 +2
-1@@ -29,7 +29,8 @@ _supported_fs ^xfs rm -f $seqres.full # Create a 1G filesystem. -_scratch_mkfs_sized $((1024 * 1024 * 1024)) >>$seqres.full 2>&1 +_scratch_mkfs_sized $((1024 * 1024 * 1024)) >>$seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount # Create a file with a size of 600M and two holes, each with a size of 1M andtests/xfs/075 +1
-1@@ -22,7 +22,7 @@ _require_scratch _qmount_option "defaults" echo "Silence is golden" -_scratch_mkfs_sized $((512 * 1024 * 1024)) >$seqres.full +_scratch_mkfs_sized $((512 * 1024 * 1024)) >$seqres.full || _fail "mkfs failed" # first ro mount with norecovery _try_scratch_mount "-o ro,norecovery" >>$seqres.full 2>&1 \tests/xfs/107 +2
-1@@ -32,7 +32,8 @@ size_mb=256 # reproduce within the first 500KB's worth of ALLOCSP calls, so running up # to 16MB should suffice. $XFS_IO_PROG -d -c "pwrite -S 0x58 -b 8m 0 ${size_mb}m" $SCRATCH_DEV > $seqres.full -MKFS_OPTIONS="-K $MKFS_OPTIONS" _scratch_mkfs_sized $((size_mb * 1048576)) >> $seqres.full +MKFS_OPTIONS="-K $MKFS_OPTIONS" _scratch_mkfs_sized $((size_mb * 1048576)) \ + >> $seqres.full || _fail "mkfs failed" _scratch_mounttests/xfs/118 +2
-1@@ -28,7 +28,8 @@ _require_command "$XFS_FSR_PROG" "xfs_fsr" _require_xfs_io_command "falloc" # 50M -_scratch_mkfs_sized $((50 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((50 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount echo "Silence is golden"tests/xfs/127 +2
-1@@ -20,7 +20,8 @@ _require_no_large_scratch_dev _require_cp_reflink echo "Format and mount" -_scratch_mkfs_sized $((512 * 1024 * 1024)) > $seqres.full 2>&1 +_scratch_mkfs_sized $((512 * 1024 * 1024)) > $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount >> $seqres.full 2>&1 testdir=$SCRATCH_MNT/test-$seqtests/xfs/227 +2
-1@@ -122,7 +122,8 @@ create_target_attr_last() } # use a small filesystem so we can control freespace easily -_scratch_mkfs_sized $((50 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mkfs_sized $((50 * 1024 * 1024)) >> $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount fragment_freespacetests/xfs/233 +2
-1@@ -18,7 +18,8 @@ _require_xfs_scratch_rmapbt _require_no_large_scratch_dev echo "Format and mount" -_scratch_mkfs_sized $((2 * 4096 * 4096)) > $seqres.full 2>&1 +_scratch_mkfs_sized $((2 * 4096 * 4096)) > $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount >> $seqres.full 2>&1 testdir=$SCRATCH_MNT/test-$seqtests/xfs/442 +2
-1@@ -68,7 +68,8 @@ _qmount_option "usrquota,grpquota,prjquota" # operations as delalloc for quota accounting") and ("xfs: call # xfs_qm_dqattach before performing reflink operations") though each of those # tests now have separate faster-running regression tests. -_scratch_mkfs_sized $((1600 * 1048576)) > $seqres.full 2>&1 +_scratch_mkfs_sized $((1600 * 1048576)) > $seqres.full 2>&1 \ + || _fail "mkfs failed" _scratch_mount >> $seqres.full 2>&1 nr_cpus=$((LOAD_FACTOR * 4))tests/xfs/529 +2
-1@@ -29,7 +29,8 @@ _require_xfs_io_error_injection "reduce_max_iextents" _require_xfs_io_error_injection "bmap_alloc_minlen_extent" echo "Format and mount fs" -_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full +_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full \ + || _fail "mkfs failed" _scratch_mount -o uquota >> $seqres.full # bmap_alloc_minlen_extent only applies to the datadev space allocator, sotests/xfs/532 +2
-1@@ -26,7 +26,8 @@ _require_xfs_io_error_injection "reduce_max_iextents" _require_xfs_io_error_injection "bmap_alloc_minlen_extent" echo "Format and mount fs" -_scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full +_scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full \ + || _fail "mkfs failed" _scratch_mount >> $seqres.full # Disable realtime inherit flag (if any) on root directory so that space on datatests/xfs/534 +2
-1@@ -22,7 +22,8 @@ _require_xfs_io_command "falloc" _require_xfs_io_error_injection "reduce_max_iextents" echo "Format and mount fs" -_scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full +_scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full \ + || _fail "mkfs failed" _scratch_mount >> $seqres.full bsize=$(_get_file_block_size $SCRATCH_MNT)tests/xfs/535 +2
-1@@ -25,7 +25,8 @@ _require_xfs_io_command "funshare" _require_xfs_io_error_injection "reduce_max_iextents" echo "Format and mount fs" -_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full +_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full \ + || _fail "mkfs failed" _scratch_mount >> $seqres.full bsize=$(_get_block_size $SCRATCH_MNT)tests/xfs/538 +2
-1@@ -23,7 +23,8 @@ _require_test_program "punch-alternating" _require_xfs_io_error_injection "bmap_alloc_minlen_extent" echo "Format and mount fs" -_scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full +_scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full \ + || _fail "mkfs failed" _scratch_mount >> $seqres.full # Disable realtime inherit flag (if any) on root directory so that space on dataSignature · 1 line
2.35.3
Re: [PATCH 2/2] tests: _fail on _scratch_mkfs_sized failure
Quoted 9 lines · Zorro Lang
Quoted 9 lines
I wonder, how many tests should keep going if
_scratch_mkfs_sizedisn't successful? Would it be simpler to make a_try_scratch_mkfs_sizedfor those callers, and make the main_scratch_mkfs_sizedsimply do
_scratch_mkfs_sized(){ _try_scratch_mkfs_sized $* || _fail "_scratch_mkfs_sized failed" }
Quoted 5 lines
Quoted 1 line
?
I agree with this. Actually I don't know what's kind of historical reasons make
_scratch_mount_faildirectly if mount fails, but_scratch_mkfsdoesn't like that?
Agreed. Unsupported mkfs should absolutely fail by default. For some tests instead of _fail it should be _notsupported, but that would be a separate helper and between the two of them we'd cover almost all uses.
Quoted 20 lines · David Disseldorp
As of xfsprogs commit
6e0ed3d1("mkfs: stop allowing tiny filesystems") attempts to create XFS filesystems sized under 300M fail, unlessTEST_DIR,TEST_DEVandQA_CHECK_FSenvironment variables are exported (or a --unsupported mkfs parameter is provided).
TEST_DIRandQA_CHECK_FSare already exported, whileTEST_DEVmay only be locally set if provided via e.g.configs/$HOSTNAME.config. Explicitly exportTEST_DEVto ensure that tests which call_scratch_mkfs_sized()with an fssize under 300M run normally.Signed-off-by David Disseldorp <[email protected]>--- common/config | 3 +++ 1 file changed, 3 insertions(+)common/config +0
-0
common/config else · line 937
Quoted 6 lines
common/config +3
-0@@ -932,6 +932,9 @@ else fi _canonicalize_devices +# mkfs.xfs checks for TEST_DEV before permitting < 300M filesystems. TEST_DIR +# and QA_CHECK_FS are also checked by mkfs.xfs, but already exported elsewhere. +export TEST_DEV
I wonder if we only ought to do this for $FSTYP = xfs, but I don't have a problem with this so
--D
Quoted 7 lines
common/config +0
-0# make sure this script returns success /bin/trueSignature · 1 line
2.35.3
Quoted 9 lines · David Disseldorp
As of xfsprogs commit
6e0ed3d1("mkfs: stop allowing tiny filesystems") attempts to create XFS filesystems sized under 300M fail, unlessTEST_DIR,TEST_DEVandQA_CHECK_FSenvironment variables are exported (or a --unsupported mkfs parameter is provided).
TEST_DIRandQA_CHECK_FSare already exported, whileTEST_DEVmay only be locally set if provided via e.g.configs/$HOSTNAME.config. Explicitly exportTEST_DEVto ensure that tests which call_scratch_mkfs_sized()with an fssize under 300M run normally.
As for fixing the immediate problem this looks fine:
But adding the xfs list as allowing to create a smaller than supported file system just for testing is pretty silly. If we don't want to support these tiny file systems, we should also not use them for testing. The best way to port over the existing tests to a larger size would probably be to round up the size to the minimum supported one and then fill the space?
Quoted 5 lines · David Disseldorp
As of xfsprogs commit
6e0ed3d1("mkfs: stop allowing tiny filesystems") attempts to create XFS filesystems sized under 300M fail, unlessTEST_DIR,TEST_DEVandQA_CHECK_FSenvironment variables are exported (or a --unsupported mkfs parameter is provided).
Quoted 7 lines
TEST_DIRandQA_CHECK_FSare already exported, whileTEST_DEVmay only be locally set if provided via e.g.configs/$HOSTNAME.config. Explicitly exportTEST_DEVto ensure that tests which call_scratch_mkfs_sized()with an fssize under 300M run normally.Signed-off-by David Disseldorp <[email protected]>---
Actually, using "export" in xfstests/local.config for each parameter could help too.
The 2nd patch still has some disagreement, I'll merge this patch at first, as it's simple enough and got two RVBs.
Thanks,
Zorro
Quoted 21 lines
common/config | 3 +++ 1 file changed, 3 insertions(+)common/config +3
-0@@ -932,6 +932,9 @@ else fi _canonicalize_devices +# mkfs.xfs checks for TEST_DEV before permitting < 300M filesystems. TEST_DIR +# and QA_CHECK_FS are also checked by mkfs.xfs, but already exported elsewhere. +export TEST_DEV # make sure this script returns success /bin/trueSignature · 1 line
2.35.3
Quoted 11 lines · Zorro Lang
Quoted 10 lines · David Disseldorp
As of xfsprogs commit
6e0ed3d1("mkfs: stop allowing tiny filesystems") attempts to create XFS filesystems sized under 300M fail, unlessTEST_DIR,TEST_DEVandQA_CHECK_FSenvironment variables are exported (or a --unsupported mkfs parameter is provided).
TEST_DIRandQA_CHECK_FSare already exported, whileTEST_DEVmay only be locally set if provided via e.g.configs/$HOSTNAME.config. Explicitly exportTEST_DEVto ensure that tests which call_scratch_mkfs_sized()with an fssize under 300M run normally.
Quoted 8 lines
Quoted 2 lines
Signed-off-by David Disseldorp <[email protected]>---
Actually, using "export" in
xfstests/local.configfor each parameter could help too.The 2nd patch still has some disagreement, I'll merge this patch at first, as it's simple enough and got two RVBs.
Thanks. I'll send an updated 2/2 today following Darrick's suggestion of _try_scratch_mkfs_sized $* || _fail
Quoted 16 lines · David Disseldorp
Quoted 14 lines · Zorro Lang
Quoted 12 lines · David Disseldorp
As of xfsprogs commit
6e0ed3d1("mkfs: stop allowing tiny filesystems") attempts to create XFS filesystems sized under 300M fail, unlessTEST_DIR,TEST_DEVandQA_CHECK_FSenvironment variables are exported (or a --unsupported mkfs parameter is provided).
TEST_DIRandQA_CHECK_FSare already exported, whileTEST_DEVmay only be locally set if provided via e.g.configs/$HOSTNAME.config. Explicitly exportTEST_DEVto ensure that tests which call_scratch_mkfs_sized()with an fssize under 300M run normally.Signed-off-by David Disseldorp <[email protected]>---
Quoted 8 lines
Quoted 5 lines
Actually, using "export" in
xfstests/local.configfor each parameter could help too.The 2nd patch still has some disagreement, I'll merge this patch at first, as it's simple enough and got two RVBs.
Thanks. I'll send an updated 2/2 today following Darrick's suggestion of
_try_scratch_mkfs_sized$* ||_fail
Thanks for doing it :)
I'm wondering if we could change all _scratch_mkfs and _scratch_mkfs_xxx helpers like that. But we can change _scratch_mkfs_sized at first, then other _scratch_mkfs_xxx helpers, then _scratch_mkfs itself.
At the same time, please don't forgot those cases do "_scratch_mkfs_xxx ... | _fail ...".
Thanks,
Zorro