stop overriding SCRATCH_{,LOG,RT}DEV v3
Hi all,
this series cleans up various tests to get out of the business of overriding the scratch devices setup. This is not only generally a little ugly, but breaks when mkfs options are incompatible with the synthesized setups.
My prime example right now are two zoned XFS options: -r rtreserved, which only works for zoned RT devices, and breaks as soon as we're running on non-RT or non-Zoned setups, and -r rtstart which only works for internal RT zoned RT devices, and breaks as soon as an actual SCRATCH_RTDEV was used. There's probably more that we've been papering over with the try_ options and by scratch_mkfs dropping options when they conflict. I plan to remove the need for the latter in a follow-on series as it leads to hard to debug bugs.
Changes since v2:
- fix the error table override in xfs/438
- fix spelling in a commit log
Changes since v1:
- pass a device to e2fsck in ext4/006
- add a _require_scratch_size to xfs/521
- ensure the file system is still mounted when checking it in xfs/528
PATCH 1/13 dmflakey: override SCRATCH_DEV in _init_flakey
_init_flakey already overrides SCRATCH_LOGDEV and SCRATCH_RTDEV so that the XFS-specific helpers work fine with external devices. Do the same for SCRATCH_DEV itself, so that _scratch_mount and _scratch_unmount just work, and so that _check_scratch_fs does not need to override the main device.
This requires some small adjustments in how generic/741 checks that mounting the underlying device fails, but the new version actually is simpler than the old one, and in xfs/438 where we need to be careful where to create the custom dm table.
--- common/dmflakey | 47 +++++++++++++++++++++---------------------- tests/btrfs/056 | 6 +++--- tests/btrfs/085 | 14 ++++++------- tests/btrfs/095 | 4 ++-- tests/btrfs/098 | 4 ++-- tests/btrfs/118 | 4 ++-- tests/btrfs/119 | 4 ++-- tests/btrfs/120 | 4 ++-- tests/btrfs/159 | 4 ++-- tests/btrfs/166 | 4 ++-- tests/btrfs/201 | 8 ++++---- tests/btrfs/209 | 4 ++-- tests/btrfs/211 | 14 ++++++------- tests/btrfs/231 | 4 ++-- tests/btrfs/233 | 20 +++++++++--------- tests/btrfs/236 | 8 ++++---- tests/btrfs/239 | 4 ++-- tests/btrfs/240 | 4 ++-- tests/btrfs/243 | 4 ++-- tests/generic/034 | 4 ++-- tests/generic/039 | 2 +- tests/generic/040 | 2 +- tests/generic/041 | 2 +- tests/generic/056 | 2 +- tests/generic/057 | 2 +- tests/generic/059 | 2 +- tests/generic/065 | 2 +- tests/generic/066 | 4 ++-- tests/generic/073 | 2 +- tests/generic/090 | 2 +- tests/generic/101 | 2 +- tests/generic/104 | 4 ++-- tests/generic/106 | 4 ++-- tests/generic/107 | 4 ++-- tests/generic/177 | 4 ++-- tests/generic/311 | 12 +++++------ tests/generic/321 | 20 +++++++++--------- tests/generic/322 | 14 ++++++------- tests/generic/325 | 4 ++-- tests/generic/335 | 4 ++-- tests/generic/336 | 4 ++-- tests/generic/341 | 4 ++-- tests/generic/342 | 4 ++-- tests/generic/343 | 4 ++-- tests/generic/348 | 4 ++-- tests/generic/376 | 4 ++-- tests/generic/456 | 4 ++-- tests/generic/479 | 4 ++-- tests/generic/480 | 4 ++-- tests/generic/481 | 4 ++-- tests/generic/483 | 4 ++-- tests/generic/489 | 4 ++-- tests/generic/498 | 4 ++-- tests/generic/501 | 4 ++-- tests/generic/502 | 4 ++-- tests/generic/509 | 4 ++-- tests/generic/510 | 4 ++-- tests/generic/512 | 4 ++-- tests/generic/520 | 12 +++++------ tests/generic/526 | 4 ++-- tests/generic/527 | 4 ++-- tests/generic/534 | 4 ++-- tests/generic/535 | 4 ++-- tests/generic/546 | 2 +- tests/generic/547 | 4 ++-- tests/generic/552 | 4 ++-- tests/generic/557 | 4 ++-- tests/generic/588 | 4 ++-- tests/generic/640 | 4 ++-- tests/generic/677 | 4 ++-- tests/generic/690 | 4 ++-- tests/generic/695 | 4 ++-- tests/generic/703 | 4 ++-- tests/generic/741 | 16 +++++++-------- tests/generic/741.out | 2 -- tests/generic/745 | 2 +- tests/generic/764 | 4 ++-- tests/generic/771 | 2 +- tests/generic/779 | 4 ++-- tests/generic/782 | 4 ++-- tests/generic/784 | 4 ++-- tests/generic/785 | 4 ++-- tests/xfs/051 | 4 ++-- tests/xfs/438 | 11 ++++++---- tests/xfs/542 | 4 ++-- tests/xfs/605 | 10 ++++----- 86 files changed, 236 insertions(+), 236 deletions(-)
common/dmflakey +23 -24
@@ -15,11 +15,19 @@ export FLAKEY_LOGNAME="flakey-logtest.$seq" _init_flakey() { # Scratch device - local BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV` - export FLAKEY_DEV="/dev/mapper/$FLAKEY_NAME" - FLAKEY_TABLE="0 $BLK_DEV_SIZE flakey $SCRATCH_DEV 0 180 0" - FLAKEY_TABLE_DROP="0 $BLK_DEV_SIZE flakey $SCRATCH_DEV 0 0 180 1 drop_writes" - FLAKEY_TABLE_ERROR="0 $BLK_DEV_SIZE flakey $SCRATCH_DEV 0 0 180 1 error_writes" + if [ -z "$NON_FLAKEY_DEV" ]; then + # Set up the device switch + local backing_dev="$SCRATCH_DEV" + export NON_FLAKEY_DEV="$SCRATCH_DEV" + SCRATCH_DEV=/dev/mapper/$FLAKEY_NAME + else + # Already set up; recreate tables + local backing_dev="$NON_FLAKEY_DEV" + fi + local BLK_DEV_SIZE=`blockdev --getsz $backing_dev` + FLAKEY_TABLE="0 $BLK_DEV_SIZE flakey $backing_dev 0 180 0" + FLAKEY_TABLE_DROP="0 $BLK_DEV_SIZE flakey $backing_dev 0 0 180 1 drop_writes" + FLAKEY_TABLE_ERROR="0 $BLK_DEV_SIZE flakey $backing_dev 0 0 180 1 error_writes" _dmsetup_create $FLAKEY_NAME --table "$FLAKEY_TABLE" || \ _fatal "failed to create flakey device"
@@ -62,32 +70,23 @@ _init_flakey() fi } -_mount_flakey() -{ - _scratch_options mount - - mount -t $FSTYP $SCRATCH_OPTIONS $MOUNT_OPTIONS $FLAKEY_DEV $SCRATCH_MNT -} - -_unmount_flakey() -{ - _unmount $SCRATCH_MNT -} - _cleanup_flakey() { # If dmsetup load fails then we need to make sure to do resume here # otherwise the umount will hang test -n "$NON_FLAKEY_LOGDEV" && $DMSETUP_PROG resume $FLAKEY_LOGNAME &> /dev/null test -n "$NON_FLAKEY_RTDEV" && $DMSETUP_PROG resume $FLAKEY_RTNAME &> /dev/null - $DMSETUP_PROG resume flakey-test > /dev/null 2>&1 + test -n "$NON_FLAKEY_DEV" && $DMSETUP_PROG resume flakey-test > /dev/null 2>&1 _unmount $SCRATCH_MNT > /dev/null 2>&1 - _dmsetup_remove $FLAKEY_NAME + test -n "$NON_FLAKEY_DEV" && _dmsetup_remove $FLAKEY_NAME test -n "$NON_FLAKEY_LOGDEV" && _dmsetup_remove $FLAKEY_LOGNAME test -n "$NON_FLAKEY_RTDEV" && _dmsetup_remove $FLAKEY_RTNAME + SCRATCH_DEV="$NON_FLAKEY_DEV" + unset NON_FLAKEY_DEV + if [ -n "$NON_FLAKEY_LOGDEV" ]; then SCRATCH_LOGDEV="$NON_FLAKEY_LOGDEV" unset NON_FLAKEY_LOGDEV
@@ -179,17 +178,17 @@ _flakey_drop_and_remount() { # If the full environment is set up, configure ourselves for shutdown type _prepare_for_eio_shutdown &>/dev/null && \ - _prepare_for_eio_shutdown $FLAKEY_DEV + _prepare_for_eio_shutdown $SCRATCH_DEV _load_flakey_table $FLAKEY_DROP_WRITES - _unmount_flakey + _scratch_unmount if [ "x$1" = "xyes" ]; then - _check_scratch_fs $FLAKEY_DEV + _check_scratch_fs fi _load_flakey_table $FLAKEY_ALLOW_WRITES - _mount_flakey + _scratch_mount } _require_flakey_with_error_writes()
@@ -206,5 +205,5 @@ _require_flakey_with_error_writes() _dmsetup_create $NAME --table "$TABLE" || \ _notrun "This test requires error_writes feature in dm-flakey" - _cleanup_flakey + _dmsetup_remove $FLAKEY_NAME }
tests/btrfs/056 +3 -3
@@ -39,7 +39,7 @@ test_btrfs_clone_fsync_log_recover() _init_flakey SAVE_MOUNT_OPTIONS="$MOUNT_OPTIONS" MOUNT_OPTIONS="$MOUNT_OPTIONS $2" - _mount_flakey + _scratch_mount BLOCK_SIZE=$(_get_block_size $SCRATCH_MNT)
@@ -89,10 +89,10 @@ test_btrfs_clone_fsync_log_recover() echo "Verifying file bar2 content" od -t x1 $SCRATCH_MNT/bar2 | _filter_od - _unmount_flakey + _scratch_unmount # Verify that there are no consistency errors. - _check_scratch_fs $FLAKEY_DEV + _check_scratch_fs _cleanup_flakey MOUNT_OPTIONS="$SAVE_MOUNT_OPTIONS"
tests/btrfs/085 +7 -7
@@ -33,7 +33,7 @@ _require_btrfs_command inspect-internal dump-tree has_orphan_item() { INO=$1 - if $BTRFS_UTIL_PROG inspect-internal dump-tree $FLAKEY_DEV | \ + if $BTRFS_UTIL_PROG inspect-internal dump-tree $SCRATCH_DEV | \ grep -q "key (ORPHAN ORPHAN_ITEM $INO)"; then return 0 fi
@@ -48,7 +48,7 @@ test_orphan() _scratch_mkfs >> $seqres.full 2>&1 _init_flakey - _mount_flakey + _scratch_mount $PRECMD
@@ -79,13 +79,13 @@ test_orphan() exec 27>&- # Orphan item should be on disk if operating correctly - _unmount_flakey + _scratch_unmount _load_flakey_table $FLAKEY_ALLOW_WRITES if ! has_orphan_item $INO; then echo "ERROR: No orphan item found after umount." return fi - _mount_flakey + _scratch_mount # If $DIR is a subvolume, this will cause a lookup and orphan cleanup (cd $DIR; true)
@@ -94,7 +94,7 @@ test_orphan() # disk until there's a sync. sync - _unmount_flakey + _scratch_unmount if has_orphan_item $INO; then echo "ERROR: Orphan item found after successful mount/sync." fi
@@ -112,8 +112,8 @@ new_default() SUB=$($BTRFS_UTIL_PROG subvolume list $SCRATCH_MNT | $AWK_PROG '{print $2}') _btrfs subvolume set-default $SUB $SCRATCH_MNT - _unmount_flakey - _mount_flakey + _scratch_unmount + _scratch_mount } echo "Testing with fs root as default subvolume"
tests/btrfs/095 +2 -2
@@ -33,7 +33,7 @@ _require_xfs_io_command "falloc" _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount BLOCK_SIZE=$(_get_block_size $SCRATCH_MNT)
@@ -127,7 +127,7 @@ _flakey_drop_and_remount echo "File contents after log replay:" od -t x1 $SCRATCH_MNT/foo | _filter_od -_unmount_flakey +_scratch_unmount status=0 exit
tests/btrfs/098 +2 -2
@@ -28,7 +28,7 @@ _require_cloner _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount BLOCK_SIZE=$(_get_block_size $SCRATCH_MNT)
@@ -89,7 +89,7 @@ echo "File contents after log replay:" # the power failure happened. od -t x1 $SCRATCH_MNT/foo | _filter_od -_unmount_flakey +_scratch_unmount status=0 exit
tests/btrfs/118 +2 -2
@@ -28,7 +28,7 @@ _require_dm_target flakey _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # Create a snapshot at the root of our filesystem (mount point path), delete it, # fsync the mount point path, crash and mount to replay the log. This should
@@ -50,7 +50,7 @@ _flakey_drop_and_remount [ -e $SCRATCH_MNT/testdir/snap2 ] && \ echo "Snapshot snap2 still exists after log replay" -_unmount_flakey +_scratch_unmount echo "Silence is golden"
tests/btrfs/119 +2 -2
@@ -27,7 +27,7 @@ _require_dm_target flakey _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount _btrfs quota enable $SCRATCH_MNT
@@ -83,7 +83,7 @@ echo "File digest before after failure:" # Must match what he got before the power failure. md5sum $SCRATCH_MNT/foobar | _filter_scratch -_unmount_flakey +_scratch_unmount status=0 exit
tests/btrfs/120 +2 -2
@@ -38,7 +38,7 @@ populate_testdir() _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount mkdir $SCRATCH_MNT/testdir populate_testdir
@@ -59,6 +59,6 @@ _flakey_drop_and_remount echo "Filesystem contents after the second log replay:" ls -R $SCRATCH_MNT | _filter_scratch -_unmount_flakey +_scratch_unmount status=0 exit
tests/btrfs/159 +2 -2
@@ -40,7 +40,7 @@ run_test() _scratch_mkfs -O no-holes -n $((64 * 1024)) >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey - _mount_flakey + _scratch_mount # Create our test file with 832 extents of 256Kb each. Before each # extent, there is a 256Kb hole (except for the first extent, which
@@ -77,7 +77,7 @@ run_test() echo "File digest after power failure and log replay:" md5sum $SCRATCH_MNT/foobar | _filter_scratch - _unmount_flakey + _scratch_unmount _cleanup_flakey }
tests/btrfs/166 +2 -2
@@ -28,7 +28,7 @@ _require_dm_target flakey _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # Enable qgroups on the filesystem. This will start the qgroup rescan kernel # thread.
@@ -39,7 +39,7 @@ _btrfs quota enable $SCRATCH_MNT # fail. _flakey_drop_and_remount -_unmount_flakey +_scratch_unmount _cleanup_flakey echo "Silence is golden"
tests/btrfs/201 +4 -4
@@ -43,7 +43,7 @@ run_test_leading_hole() _scratch_mkfs -O no-holes -n $((64 * 1024)) >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey - _mount_flakey + _scratch_mount # Create our first file, which is used just to fill space in a leaf. Its # items ocuppy most of the first leaf. We use a large xattr since it's an
@@ -86,7 +86,7 @@ run_test_leading_hole() echo "File digest after power failure and log replay:" md5sum $SCRATCH_MNT/bar | _filter_scratch - _unmount_flakey + _scratch_unmount _cleanup_flakey }
@@ -105,7 +105,7 @@ run_test_middle_hole() _scratch_mkfs -O no-holes -n $((64 * 1024)) >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey - _mount_flakey + _scratch_mount # Create our first file, which is used just to fill space in a leaf. Its # items ocuppy most of the first leaf. We use a large xattr since it's an
@@ -150,7 +150,7 @@ run_test_middle_hole() echo "File digest after power failure and log replay:" md5sum $SCRATCH_MNT/bar | _filter_scratch - _unmount_flakey + _scratch_unmount _cleanup_flakey }
tests/btrfs/209 +2 -2
@@ -33,7 +33,7 @@ _require_xfs_io_command "sync_range" _scratch_mkfs -O ^no-holes >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # Create a 256K file with a single extent and fsync it to clear the full sync # bit from the inode - we want the msync below to trigger a fast fsync.
@@ -71,7 +71,7 @@ echo "File digest after power failure: $(_md5_checksum $SCRATCH_MNT/foo)" # We also want to check that fsck doesn't fail due to an error of a missing # file extent item that represents a hole for the range 256K to 512K. The # fstests framework does the fsck once the test exits. -_unmount_flakey +_scratch_unmount status=0 exit
tests/btrfs/211 +7 -7
@@ -64,10 +64,10 @@ run_test() # Unmount the filesystem and run 'btrfs check'/fsck to verify that we don't # have a missing hole for the file range from 64K to 128K. - _unmount_flakey - _check_scratch_fs $FLAKEY_DEV + _scratch_unmount + _check_scratch_fs - _mount_flakey + _scratch_mount # Now write to the file range from 0 to 128K. After this we should still have # rwo extents in our file, corresponding to the 2 extents we allocated before
@@ -80,23 +80,23 @@ run_test() _scratch_mkfs -O ^no-holes >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount echo "Testing without NO_HOLES feature" run_test -_unmount_flakey +_scratch_unmount _cleanup_flakey _scratch_mkfs -O no-holes >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount echo echo "Testing with the NO_HOLES feature" run_test -_unmount_flakey +_scratch_unmount status=0 exit
tests/btrfs/231 +2 -2
@@ -32,7 +32,7 @@ _require_dm_target flakey _scratch_mkfs -O no-holes >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # Create our test file with 3 extents of 256K and a 256K hole at offset 256K. # The file has a size of 1280K.
@@ -73,6 +73,6 @@ _flakey_drop_and_remount echo "File data after power failure:" od -A d -t x1 $SCRATCH_MNT/foobar -_unmount_flakey +_scratch_unmount status=0 exit
tests/btrfs/233 +10 -10
@@ -30,7 +30,7 @@ _require_btrfs_command inspect-internal dump-tree _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount check_subvol_orphan_item_exists() {
@@ -84,7 +84,7 @@ create_subvol_with_orphan() # RW mount. _load_flakey_table $FLAKEY_DROP_WRITES exec 73>&- - _unmount_flakey + _scratch_unmount check_subvol_orphan_item_exists check_subvol_btree_exists
@@ -99,9 +99,9 @@ create_subvol_with_orphan # Use a commit interval lower than the default (30 seconds) so that the test # is faster and we spend less time waiting for transaction commits. MOUNT_OPTIONS="-o commit=1" -_mount_flakey +_scratch_mount $BTRFS_UTIL_PROG subvolume sync $SCRATCH_MNT >>$seqres.full -_unmount_flakey +_scratch_unmount check_subvol_orphan_item_not_exists check_subvol_btree_not_exists
@@ -110,15 +110,15 @@ check_subvol_btree_not_exists _cleanup_flakey _scratch_mkfs >>$seqres.full 2>&1 _init_flakey -_mount_flakey +_scratch_mount create_subvol_with_orphan MOUNT_OPTIONS="-o ro,commit=1" -_mount_flakey +_scratch_mount # The subvolume path should not be accessible anymore, even if deletion of the # subvolume btree did not happen yet. [ -e $SCRATCH_MNT/testsv ] && echo "subvolume path still exists" -_unmount_flakey +_scratch_unmount # The subvolume btree should still exist, even though the path is not accessible. check_subvol_btree_exists
@@ -127,15 +127,15 @@ check_subvol_btree_exists check_subvol_orphan_item_exists # Mount the filesystem RO again. -_mount_flakey +_scratch_mount # Now remount RW, then unmount and then check the subvolume's orphan item, btree # and path don't exist anymore. MOUNT_OPTIONS="-o remount,rw" -_mount_flakey +_scratch_mount $BTRFS_UTIL_PROG subvolume sync $SCRATCH_MNT >>$seqres.full [ -e $SCRATCH_MNT/testsv ] && echo "subvolume path still exists" -_unmount_flakey +_scratch_unmount check_subvol_orphan_item_not_exists check_subvol_btree_not_exists
tests/btrfs/236 +4 -4
@@ -157,7 +157,7 @@ _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey MOUNT_OPTIONS="-o datacow" -_mount_flakey +_scratch_mount # Test a few times each scenario because this test was motivated by a race # condition.
@@ -170,12 +170,12 @@ for ((i = 1; i <= 3; i++)); do test_fsync "link_cow_$i" "link" done -_unmount_flakey +_scratch_unmount # Now lets test with nodatacow. if ! _scratch_btrfs_is_zoned; then MOUNT_OPTIONS="-o nodatacow" - _mount_flakey + _scratch_mount echo "Testing fsync after rename with NOCOW writes" for ((i = 1; i <= 3; i++)); do
@@ -186,7 +186,7 @@ if ! _scratch_btrfs_is_zoned; then test_fsync "link_nocow_$i" "link" done - _unmount_flakey + _scratch_unmount else # Fake result. Zoned btrfs does not support NOCOW echo "Testing fsync after rename with NOCOW writes"
tests/btrfs/239 +2 -2
@@ -38,7 +38,7 @@ _require_dm_target flakey _scratch_mkfs "-n 65536" >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # "testdir" is inode 257. mkdir $SCRATCH_MNT/testdir
@@ -195,7 +195,7 @@ _flakey_drop_and_remount echo "File $SCRATCH_MNT/testdir/file1 data:" | _filter_scratch od -A d -t x1 $SCRATCH_MNT/testdir/file1 -_unmount_flakey +_scratch_unmount status=0 exit
tests/btrfs/240 +2 -2
@@ -31,7 +31,7 @@ _require_xfs_io_command "falloc" _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # Create our test file with 2 preallocated extents. Leave a 1M hole between them # to ensure that we get two file extent items that will never be merged into a
@@ -157,7 +157,7 @@ _flakey_drop_and_remount echo "File content before after failure:" od -A d -t x1 $SCRATCH_MNT/foobar -_unmount_flakey +_scratch_unmount status=0 exit
tests/btrfs/243 +2 -2
@@ -31,7 +31,7 @@ rm -f $seqres.full _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # Create our test files. touch $SCRATCH_MNT/foo
@@ -82,7 +82,7 @@ od -A d -t x1 $SCRATCH_MNT/bar2 [ -f $SCRATCH_MNT/foo2 ] || echo "File name foo2 does not exists" [ -f $SCRATCH_MNT/foo ] && echo "File name foo still exists" -_unmount_flakey +_scratch_unmount # success, all done status=0
tests/generic/034 +2 -2
@@ -32,7 +32,7 @@ _require_dm_target flakey _scratch_mkfs >> $seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount mkdir $SCRATCH_MNT/test_dir touch $SCRATCH_MNT/test_dir/foo
@@ -66,7 +66,7 @@ rm -f $SCRATCH_MNT/test_dir/bar rmdir $SCRATCH_MNT/test_dir [ -d $SCRATCH_MNT/test_dir ] && echo "rmdir didn't succeed" -_unmount_flakey +_scratch_unmount echo "Silence is golden"
tests/generic/039 +1 -1
@@ -36,7 +36,7 @@ _require_dm_target flakey _scratch_mkfs >> $seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # Create a test file with 2 hard links in the same directory. mkdir -p $SCRATCH_MNT/a/b
tests/generic/040 +1 -1
@@ -49,7 +49,7 @@ fi _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # Create a test file with 3001 hard links. This number is large enough to # make btrfs start using extrefs at some point even if the fs has the maximum
tests/generic/041 +1 -1
@@ -53,7 +53,7 @@ fi _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # Create a test file with 3001 hard links. This number is large enough to # make btrfs start using extrefs at some point even if the fs has the maximum
tests/generic/056 +1 -1
@@ -34,7 +34,7 @@ _require_dm_target flakey _scratch_mkfs >> $seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # Create one file with data and fsync it. # This made the btrfs fsync log persist the data and the inode metadata with
tests/generic/057 +1 -1
@@ -34,7 +34,7 @@ _require_dm_target flakey _scratch_mkfs >> $seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # Create our test file with some data. $XFS_IO_PROG -f -c "pwrite -S 0xaa -b 8K 0 8K" \
tests/generic/059 +1 -1
@@ -42,7 +42,7 @@ _require_xfs_io_command "fpunch" _scratch_mkfs >> $seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # Create our test file. $XFS_IO_PROG -f -c "pwrite -S 0x22 -b 16K 0 16K" \
tests/generic/065 +1 -1
@@ -35,7 +35,7 @@ _require_dm_target flakey _scratch_mkfs >> $seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # Create our main test file and directory. $XFS_IO_PROG -f -c "pwrite -S 0xaa 0 8K" $SCRATCH_MNT/foo | _filter_xfs_io
tests/generic/066 +2 -2
@@ -40,7 +40,7 @@ _require_attrs _scratch_mkfs >> $seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # Create out test file and add 3 xattrs to it. touch $SCRATCH_MNT/foobar
@@ -89,7 +89,7 @@ _flakey_drop_and_remount echo "xattr names and values after second fsync log replay:" _getfattr --absolute-names --dump $SCRATCH_MNT/foobar | _filter_scratch -_unmount_flakey +_scratch_unmount status=0 exit
tests/generic/073 +1 -1
@@ -34,7 +34,7 @@ _require_dm_target flakey _scratch_mkfs >> $seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # Create our main test file 'foo', the one we check for data loss. # By doing an fsync against our file, it makes btrfs clear the 'needs_full_sync'
tests/generic/090 +1 -1
@@ -33,7 +33,7 @@ _require_dm_target flakey _scratch_mkfs >> $seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # Create the test file with some initial data and then fsync it. # The fsync here is only needed to trigger the issue in btrfs, as it causes the
tests/generic/101 +1 -1
@@ -40,7 +40,7 @@ fi _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # Create our test files and make sure everything is durably persisted. $XFS_IO_PROG -f -c "pwrite -S 0xaa 0 64K" \
tests/generic/104 +2 -2
@@ -30,7 +30,7 @@ _require_dm_target flakey _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # Create our test directory and files. mkdir $SCRATCH_MNT/testdir
@@ -58,7 +58,7 @@ echo "Link count for file bar: $(stat -c %h $SCRATCH_MNT/testdir/bar)" rm -f $SCRATCH_MNT/testdir/* rmdir $SCRATCH_MNT/testdir -_unmount_flakey +_scratch_unmount # The fstests framework will call fsck against our filesystem which will verify # that all metadata is in a consistent state.
tests/generic/106 +2 -2
@@ -29,7 +29,7 @@ _require_dm_target flakey _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # Create our test file with 2 hard links. mkdir $SCRATCH_MNT/testdir
@@ -56,7 +56,7 @@ ls -1 $SCRATCH_MNT/testdir rm -f $SCRATCH_MNT/testdir/* rmdir $SCRATCH_MNT/testdir -_unmount_flakey +_scratch_unmount # The fstests framework will call fsck against our filesystem which will verify # that all metadata is in a consistent state.
tests/generic/107 +2 -2
@@ -32,7 +32,7 @@ _require_dm_target flakey _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # Create our test directory and file. mkdir $SCRATCH_MNT/testdir
@@ -61,7 +61,7 @@ ls -1 $SCRATCH_MNT/testdir rm -f $SCRATCH_MNT/testdir/* rmdir $SCRATCH_MNT/testdir -_unmount_flakey +_scratch_unmount status=0 exit
tests/generic/177 +2 -2
@@ -34,7 +34,7 @@ _require_dm_target flakey _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount BLOCK_SIZE=$(_get_file_block_size $SCRATCH_MNT)
@@ -77,7 +77,7 @@ echo "Fiemap after log replay:" # Must match the same extent listing we got before the power failure. $XFS_IO_PROG -c "fiemap -v" $SCRATCH_MNT/foobar | _filter_fiemap $BLOCK_SIZE -_unmount_flakey +_scratch_unmount status=0 exit
tests/generic/311 +6 -6
@@ -56,19 +56,19 @@ _run_test() _md5_checksum $testfile _load_flakey_table $FLAKEY_DROP_WRITES $lockfs - _unmount_flakey + _scratch_unmount #Ok mount so that any recovery that needs to happen is done _load_flakey_table $FLAKEY_ALLOW_WRITES - _mount_flakey + _scratch_mount _md5_checksum $testfile #Unmount and fsck to make sure we got a valid fs after replay - _unmount_flakey - _check_scratch_fs $FLAKEY_DEV + _scratch_unmount + _check_scratch_fs [ $? -ne 0 ] && _fatal "fsck failed" - _mount_flakey + _scratch_mount } _scratch_mkfs >> $seqres.full 2>&1
@@ -76,7 +76,7 @@ _require_metadata_journaling $SCRATCH_DEV # Create a basic flakey device that will never error out _init_flakey -_mount_flakey +_scratch_mount buffered=0 direct=1
tests/generic/321 +10 -10
@@ -26,24 +26,24 @@ _require_dm_target flakey _clean_working_dir() { - _mount_flakey + _scratch_mount rm -rf $SCRATCH_MNT/foo $SCRATCH_MNT/bar - _unmount_flakey + _scratch_unmount } # Btrfs wasn't making sure the directory survived fsync _directory_test() { echo "fsync new directory" - _mount_flakey + _scratch_mount mkdir $SCRATCH_MNT/bar $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/bar _flakey_drop_and_remount _ls_l $SCRATCH_MNT | tail -n +2 | awk '{ print $1, $9 }' - _unmount_flakey - _check_scratch_fs $FLAKEY_DEV + _scratch_unmount + _check_scratch_fs [ $? -ne 0 ] && _fatal "fsck failed" }
@@ -51,7 +51,7 @@ _directory_test() _rename_test() { echo "rename fsync test" - _mount_flakey + _scratch_mount touch $SCRATCH_MNT/foo mkdir $SCRATCH_MNT/bar $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/foo
@@ -63,8 +63,8 @@ _rename_test() _ls_l $SCRATCH_MNT | tail -n +2 | awk '{ print $1, $9 }' _ls_l $SCRATCH_MNT/bar | tail -n +2 | awk '{ print $1, $9 }' - _unmount_flakey - _check_scratch_fs $FLAKEY_DEV + _scratch_unmount + _check_scratch_fs [ $? -ne 0 ] && _fatal "fsck failed" }
@@ -73,7 +73,7 @@ _rename_test() _replay_rename_test() { echo "replay rename fsync test" - _mount_flakey + _scratch_mount touch $SCRATCH_MNT/foo mkdir $SCRATCH_MNT/bar $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/foo
@@ -90,7 +90,7 @@ _replay_rename_test() _ls_l $SCRATCH_MNT | tail -n +2 | awk '{ print $1, $9 }' _ls_l $SCRATCH_MNT/bar | tail -n +2 | awk '{ print $1, $9 }' - _unmount_flakey + _scratch_unmount } _scratch_mkfs >> $seqres.full 2>&1
tests/generic/322 +7 -7
@@ -24,16 +24,16 @@ _require_dm_target flakey _clean_working_dir() { - _mount_flakey + _scratch_mount rm -rf $SCRATCH_MNT/foo $SCRATCH_MNT/bar - _unmount_flakey + _scratch_unmount } # Btrfs wasn't making sure the new file after rename survived the fsync _rename_test() { echo "fsync rename test" - _mount_flakey + _scratch_mount $XFS_IO_PROG -f -c "pwrite 0 1M" -c "fsync" $SCRATCH_MNT/foo \ >> $seqres.full 2>&1 mv $SCRATCH_MNT/foo $SCRATCH_MNT/bar
@@ -43,8 +43,8 @@ _rename_test() _flakey_drop_and_remount md5sum $SCRATCH_MNT/bar | _filter_scratch - _unmount_flakey - _check_scratch_fs $FLAKEY_DEV + _scratch_unmount + _check_scratch_fs [ $? -ne 0 ] && _fatal "fsck failed" }
@@ -53,7 +53,7 @@ _rename_test() _write_after_fsync_rename_test() { echo "fsync rename test" - _mount_flakey + _scratch_mount $XFS_IO_PROG -f -c "pwrite 0 1M" -c "fsync" -c "pwrite 2M 1M" \ -c "sync_range -b 2M 1M" $SCRATCH_MNT/foo >> $seqres.full 2>&1 mv $SCRATCH_MNT/foo $SCRATCH_MNT/bar
@@ -63,7 +63,7 @@ _write_after_fsync_rename_test() _flakey_drop_and_remount md5sum $SCRATCH_MNT/bar | _filter_scratch - _unmount_flakey + _scratch_unmount } _scratch_mkfs >> $seqres.full 2>&1
tests/generic/325 +2 -2
@@ -34,7 +34,7 @@ _require_dm_target flakey _scratch_mkfs >> $seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # Create the file first. $XFS_IO_PROG -f -c "pwrite -S 0xff 0 256K" $SCRATCH_MNT/foo | _filter_xfs_io
@@ -69,7 +69,7 @@ _flakey_drop_and_remount echo "File content after crash/reboot and fs mount:" od -t x1 $SCRATCH_MNT/foo -_unmount_flakey +_scratch_unmount status=0 exit
tests/generic/335 +2 -2
@@ -29,7 +29,7 @@ _require_dm_target flakey _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # Create our test directories and the file we will later check if it has # disappeared.
@@ -73,7 +73,7 @@ echo "Filesystem content after power failure:" # Must match what we had before the power failure. ls -R $SCRATCH_MNT/a $SCRATCH_MNT/c | _filter_scratch -_unmount_flakey +_scratch_unmount status=0 exit
tests/generic/336 +2 -2
@@ -36,7 +36,7 @@ _require_dm_target flakey _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # Create our test directories and the file we will later check if it has # disappeared (file bar).
@@ -70,7 +70,7 @@ echo "Filesystem content after power failure:" # Must match what we had before the power failure. ls -R $SCRATCH_MNT/a $SCRATCH_MNT/b $SCRATCH_MNT/c | _filter_scratch -_unmount_flakey +_scratch_unmount status=0 exit
tests/generic/341 +2 -2
@@ -30,7 +30,7 @@ _require_dm_target flakey _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount mkdir -p $SCRATCH_MNT/a/x $XFS_IO_PROG -f -c "pwrite -S 0xaf 0 32K" $SCRATCH_MNT/a/x/foo | _filter_xfs_io
@@ -62,6 +62,6 @@ echo "File digests after log replay:" md5sum $SCRATCH_MNT/a/y/foo | _filter_scratch md5sum $SCRATCH_MNT/a/y/bar | _filter_scratch -_unmount_flakey +_scratch_unmount status=0 exit
tests/generic/342 +2 -2
@@ -35,7 +35,7 @@ if [ $FSTYP = "f2fs" ]; then fi _init_flakey -_mount_flakey +_scratch_mount mkdir $SCRATCH_MNT/a $XFS_IO_PROG -f -c "pwrite -S 0xf1 0 16K" $SCRATCH_MNT/a/foo | _filter_xfs_io
@@ -64,6 +64,6 @@ echo "File digests after log replay:" md5sum $SCRATCH_MNT/a/foo | _filter_scratch md5sum $SCRATCH_MNT/a/bar | _filter_scratch -_unmount_flakey +_scratch_unmount status=0 exit
tests/generic/343 +2 -2
@@ -31,7 +31,7 @@ _require_dm_target flakey _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # Create our test directories and files. mkdir $SCRATCH_MNT/x
@@ -56,6 +56,6 @@ _flakey_drop_and_remount echo "Filesystem contents after log replay:" ls -R $SCRATCH_MNT/x $SCRATCH_MNT/y | _filter_scratch -_unmount_flakey +_scratch_unmount status=0 exit
tests/generic/348 +2 -2
@@ -31,7 +31,7 @@ _require_dm_target flakey _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount mkdir $SCRATCH_MNT/testdir1 # Make sure it's durably persisted.
@@ -54,6 +54,6 @@ echo "Symlink contents after log replay:" readlink $SCRATCH_MNT/testdir1/bar1 | _filter_scratch readlink $SCRATCH_MNT/testdir2/bar2 | _filter_scratch -_unmount_flakey +_scratch_unmount status=0 exit
tests/generic/376 +2 -2
@@ -30,7 +30,7 @@ _require_dm_target flakey _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # Create our test directories and files. mkdir $SCRATCH_MNT/dir
@@ -46,6 +46,6 @@ _flakey_drop_and_remount echo "Filesystem contents after log replay:" ls -R $SCRATCH_MNT/dir | _filter_scratch -_unmount_flakey +_scratch_unmount status=0 exit
tests/generic/456 +2 -2
@@ -40,7 +40,7 @@ _scratch_mkfs >> $seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # See this post for reverse engineering of this auto generated test: # https://marc.info/?l=linux-ext4&m=151137380830381&w=2
@@ -56,7 +56,7 @@ EOF run_check $FSX_PROG -d --replay-ops $fsxops $SCRATCH_MNT/testfile _flakey_drop_and_remount -_unmount_flakey +_scratch_unmount _cleanup_flakey _check_scratch_fs
tests/generic/479 +2 -2
@@ -36,7 +36,7 @@ run_test() _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey - _mount_flakey + _scratch_mount mkdir $SCRATCH_MNT/testdir case $file_type in
@@ -75,7 +75,7 @@ run_test() # replaying the fsync log/journal succeeds, that is the mount operation # does not fail. _flakey_drop_and_remount - _unmount_flakey + _scratch_unmount _cleanup_flakey }
tests/generic/480 +2 -2
@@ -31,7 +31,7 @@ _require_dm_target flakey _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount mkdir $SCRATCH_MNT/testdir touch $SCRATCH_MNT/testdir/foo
@@ -50,7 +50,7 @@ $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/testdir/bar # the fsync log/journal succeeds, that is the mount operation does not fail. _flakey_drop_and_remount -_unmount_flakey +_scratch_unmount _cleanup_flakey echo "Silence is golden"
tests/generic/481 +2 -2
@@ -31,7 +31,7 @@ _require_dm_target flakey _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # create a file and keep it in write ahead log $XFS_IO_PROG -f -c "fsync" $SCRATCH_MNT/foo
@@ -42,7 +42,7 @@ _flakey_drop_and_remount # see if we can create a new file successfully touch $SCRATCH_MNT/bar -_unmount_flakey +_scratch_unmount echo "Silence is golden"
tests/generic/483 +2 -2
@@ -31,7 +31,7 @@ _require_xfs_io_command "fiemap" _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # The fiemap results in the golden output requires file allocations to align to # 256K boundaries.
@@ -95,7 +95,7 @@ $XFS_IO_PROG -c "fiemap -v" $SCRATCH_MNT/baz | _filter_hole_fiemap echo "File baz size:" stat --format %s $SCRATCH_MNT/baz -_unmount_flakey +_scratch_unmount _cleanup_flakey status=0
tests/generic/489 +2 -2
@@ -30,7 +30,7 @@ _require_attrs _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount touch $SCRATCH_MNT/foobar $SETFATTR_PROG -n user.xa1 -v qwerty $SCRATCH_MNT/foobar
@@ -53,7 +53,7 @@ _getfattr --absolute-names --dump $SCRATCH_MNT/foobar | _filter_scratch echo "File data after power failure:" od -t x1 $SCRATCH_MNT/foobar -_unmount_flakey +_scratch_unmount _cleanup_flakey status=0
tests/generic/498 +2 -2
@@ -30,7 +30,7 @@ _require_dm_target flakey _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount mkdir $SCRATCH_MNT/A mkdir $SCRATCH_MNT/B
@@ -49,7 +49,7 @@ _flakey_drop_and_remount [ -d $SCRATCH_MNT/A ] || echo "directory A missing" [ -f $SCRATCH_MNT/B/foo ] || echo "file B/foo is missing" -_unmount_flakey +_scratch_unmount echo "Silence is golden" status=0
tests/generic/501 +2 -2
@@ -31,7 +31,7 @@ _require_dm_target flakey _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount _require_congruent_file_oplen $SCRATCH_MNT 2097152 # Use file sizes and offsets/lengths for the clone operation that are multiples
@@ -57,7 +57,7 @@ _flakey_drop_and_remount echo "File bar digest after power failure:" md5sum $SCRATCH_MNT/bar | _filter_scratch -_unmount_flakey +_scratch_unmount _cleanup_flakey status=0
tests/generic/502 +2 -2
@@ -38,7 +38,7 @@ if [ $FSTYP = "f2fs" ]; then fi _init_flakey -_mount_flakey +_scratch_mount # Create our test file with 2 hard links in the same parent directory. mkdir $SCRATCH_MNT/testdir
@@ -69,7 +69,7 @@ _flakey_drop_and_remount echo "Contents of test directory after the power failure:" ls -R $SCRATCH_MNT/testdir | _filter_scratch -_unmount_flakey +_scratch_unmount _cleanup_flakey status=0
tests/generic/509 +2 -2
@@ -30,7 +30,7 @@ _require_dm_target flakey _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # Create our tmpfile, write some data to it and fsync it. We want a power # failure to happen after the fsync, so that we have an inode with a link
@@ -43,7 +43,7 @@ $XFS_IO_PROG -T \ # Simulate a power failure and mount the filesystem to check that it succeeds. _flakey_drop_and_remount -_unmount_flakey +_scratch_unmount status=0 exit
tests/generic/510 +2 -2
@@ -30,7 +30,7 @@ _require_dm_target flakey _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # Create our test directories and file. mkdir $SCRATCH_MNT/testdir
@@ -56,7 +56,7 @@ _flakey_drop_and_remount echo "Filesystem content after power failure:" ls -R $SCRATCH_MNT/testdir | _filter_scratch -_unmount_flakey +_scratch_unmount status=0 exit
tests/generic/512 +2 -2
@@ -31,7 +31,7 @@ _require_dm_target flakey _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount $XFS_IO_PROG -f \ -c "pwrite -S 0xb6 0 21" \
@@ -46,7 +46,7 @@ _flakey_drop_and_remount echo "File content after power failure:" od -t x1 -A d $SCRATCH_MNT/foobar -_unmount_flakey +_scratch_unmount status=0 exit
tests/generic/520 +6 -6
@@ -43,9 +43,9 @@ after="" # adds about 10 seconds of delay in total for the 37 tests. clean_dir() { - _mount_flakey + _scratch_mount rm -rf $(find $SCRATCH_MNT/* | grep -v "lost+found") - _unmount_flakey + _scratch_unmount } check_consistency()
@@ -61,8 +61,8 @@ check_consistency() echo "After: $after" fi - _unmount_flakey - _check_scratch_fs $FLAKEY_DEV + _scratch_unmount + _check_scratch_fs } # create a hard link $2 to file $1, and fsync $3, followed by power-cut
@@ -82,7 +82,7 @@ test_link_fsync() echo -ne "\n=== link $src $dest with fsync $fsync ===\n" | \ _filter_scratch - _mount_flakey + _scratch_mount # Now execute the workload # Create the directory in which the source and destination files
@@ -116,7 +116,7 @@ test_link_sync() before="" after="" echo -ne "\n=== link $src $dest with sync ===\n" | _filter_scratch - _mount_flakey + _scratch_mount # now execute the workload # Create the directory in which the source and destination files
tests/generic/526 +2 -2
@@ -36,7 +36,7 @@ if [ $FSTYP = "f2fs" ]; then fi _init_flakey -_mount_flakey +_scratch_mount mkdir $SCRATCH_MNT/testdir echo -n "foo" > $SCRATCH_MNT/testdir/fname1
@@ -63,7 +63,7 @@ echo "File fname2 data after power failure: $(cat $SCRATCH_MNT/testdir/fname2)" echo "File fname3 data after power failure: $(cat $SCRATCH_MNT/testdir/fname3)" echo "File fname4 data after power failure: $(cat $SCRATCH_MNT/testdir/fname4)" -_unmount_flakey +_scratch_unmount status=0 exit
tests/generic/527 +2 -2
@@ -36,7 +36,7 @@ if [ $FSTYP = "f2fs" ]; then fi _init_flakey -_mount_flakey +_scratch_mount mkdir $SCRATCH_MNT/testdir echo -n "foo" > $SCRATCH_MNT/testdir/fname1
@@ -88,7 +88,7 @@ echo "File a2 data after power failure: $(cat $SCRATCH_MNT/testdir2/a2)" echo "File zz data after power failure: $(cat $SCRATCH_MNT/testdir2/zz)" echo "File zz_link data after power failure: $(cat $SCRATCH_MNT/testdir2/zz_link)" -_unmount_flakey +_scratch_unmount status=0 exit
tests/generic/534 +2 -2
@@ -28,7 +28,7 @@ _require_dm_target flakey _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # Create our test file with an initial size of 8000 bytes, then fsync it, # followed by a truncate that reduces its size down to 3000 bytes.
@@ -51,7 +51,7 @@ _flakey_drop_and_remount echo "File content after power failure:" od -A d -t x1 $SCRATCH_MNT/bar -_unmount_flakey +_scratch_unmount status=0 exit
tests/generic/535 +2 -2
@@ -48,7 +48,7 @@ do_check() local target=$1 local is_dir=$2 - _mount_flakey + _scratch_mount if [ $is_dir = 1 ]; then mkdir $target
@@ -81,7 +81,7 @@ do_check() else rm -f $target fi - _unmount_flakey + _scratch_unmount } echo "Silence is golden"
tests/generic/546 +1 -1
@@ -36,7 +36,7 @@ _require_dm_target flakey _scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount _require_congruent_file_oplen $SCRATCH_MNT 4096 # Create preallocated extent where we can write into
tests/generic/547 +2 -2
@@ -36,7 +36,7 @@ mkdir $fssum_files_dir _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount mkdir $SCRATCH_MNT/test args=`_scale_fsstress_args -p 4 -n 100 -d $SCRATCH_MNT/test`
@@ -59,7 +59,7 @@ _flakey_drop_and_remount # must match. $FSSUM_PROG -r $fssum_files_dir/fs_digest $SCRATCH_MNT/test -_unmount_flakey +_scratch_unmount status=0 exit
tests/generic/552 +2 -2
@@ -30,7 +30,7 @@ _require_dm_target flakey _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # Create our test directory with two files in it. mkdir $SCRATCH_MNT/dir
@@ -84,6 +84,6 @@ _flakey_drop_and_remount echo "File data after power failure:" od -t x1 -A d $SCRATCH_MNT/dir/baz -_unmount_flakey +_scratch_unmount status=0 exit
tests/generic/557 +2 -2
@@ -28,7 +28,7 @@ _require_dm_target flakey _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # Create our test directory with one file in it and fsync the file. mkdir $SCRATCH_MNT/dir
@@ -64,7 +64,7 @@ _flakey_drop_and_remount [ -f $SCRATCH_MNT/dir/foo ] && echo "File foo still exists" -_unmount_flakey +_scratch_unmount echo "Silence is golden" status=0 exit
tests/generic/588 +2 -2
@@ -31,7 +31,7 @@ _require_dm_target flakey _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount _require_congruent_file_oplen $SCRATCH_MNT 65536
@@ -65,6 +65,6 @@ _flakey_drop_and_remount echo "File digest after mount:" _md5_checksum $SCRATCH_MNT/foobar -_unmount_flakey +_scratch_unmount status=0 exit
tests/generic/640 +2 -2
@@ -30,7 +30,7 @@ _require_dm_target flakey _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # Create two test directories, one with a file we will rename later. mkdir $SCRATCH_MNT/A
@@ -94,6 +94,6 @@ fi [ -f $SCRATCH_MNT/A/bar ] || echo "File A/bar is missing" [ -f $SCRATCH_MNT/baz ] || echo "File baz is missing" -_unmount_flakey +_scratch_unmount status=0 exit
tests/generic/677 +2 -2
@@ -34,7 +34,7 @@ rm -f $seqres.full _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # The fiemap results in the golden output requires file allocations to align to # 1MB boundaries.
@@ -80,7 +80,7 @@ _flakey_drop_and_remount echo "List of extents after power failure:" $XFS_IO_PROG -c "fiemap -v" $SCRATCH_MNT/foo | _filter_fiemap -_unmount_flakey +_scratch_unmount # success, all done status=0
tests/generic/690 +2 -2
@@ -46,7 +46,7 @@ fi _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # Create our test directory. mkdir "$SCRATCH_MNT"/testdir
@@ -80,7 +80,7 @@ _flakey_drop_and_remount symlink_content=$(readlink "$SCRATCH_MNT"/testdir/baz | _filter_scratch) echo "symlink content: ${symlink_content}" -_unmount_flakey +_scratch_unmount # success, all done status=0
tests/generic/695 +2 -2
@@ -35,7 +35,7 @@ _require_xfs_io_command "fiemap" _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # We punch 2M holes and require extent allocations to align to 2M in fiemap # results.
@@ -83,7 +83,7 @@ $XFS_IO_PROG -c "fiemap -v" $SCRATCH_MNT/foobar | _filter_fiemap echo "File content after power failure:" _hexdump $SCRATCH_MNT/foobar -_unmount_flakey +_scratch_unmount # success, all done status=0
tests/generic/703 +2 -2
@@ -53,7 +53,7 @@ _require_fio $fio_config _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # We do 64K writes in the fio job. _require_congruent_file_oplen $SCRATCH_MNT $((64 * 1024))
@@ -94,7 +94,7 @@ if [ "$digest_after" != "$digest_before" ]; then echo "Digest after power failure: $digest_after" fi -_unmount_flakey +_scratch_unmount # success, all done echo "Silence is golden"
tests/generic/741 +8 -8
@@ -19,7 +19,7 @@ _cleanup() _unmount $extra_mnt &> /dev/null _unmount $extra_mnt &> /dev/null rm -rf $extra_mnt - _unmount_flakey + _scratch_unmount _cleanup_flakey cd / rm -r -f $tmp.*
@@ -38,7 +38,7 @@ _require_dm_target flakey _scratch_mkfs >> $seqres.full _init_flakey -_mount_flakey +_scratch_mount extra_mnt=$TEST_DIR/extra_mnt rm -rf $extra_mnt
@@ -46,13 +46,13 @@ mkdir -p $extra_mnt # Mount must fail because the physical device has a dm created on it. # Filters alter the return code of the mount. -_mount $SCRATCH_DEV $extra_mnt 2>&1 | \ - _filter_testdir_and_scratch | _filter_error_mount +_mount $NON_FLAKEY_DEV $extra_mnt 2>/dev/null && \ + _fail "mount of busy device succeeded" -# Try again with flakey unmounted, must fail. -_unmount_flakey -_mount $SCRATCH_DEV $extra_mnt 2>&1 | \ - _filter_testdir_and_scratch | _filter_error_mount +# Try again with flakey unmounted, must also fail. +_scratch_unmount +_mount $NON_FLAKEY_DEV $extra_mnt 2>/dev/null && \ + _fail "mount of busy device succeeded" # Removing dm should make mount successful. _cleanup_flakey
tests/generic/741.out +0 -2
@@ -1,3 +1 @@ QA output created by 741 -mount: TEST_DIR/extra_mnt: SCRATCH_DEV already mounted or mount point busy -mount: TEST_DIR/extra_mnt: SCRATCH_DEV already mounted or mount point busy
tests/generic/745 +1 -1
@@ -46,7 +46,7 @@ esac _scratch_mkfs >> $seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # Create the test file with some initial data and make sure everything is # durably persisted.
tests/generic/764 +2 -2
@@ -30,7 +30,7 @@ _require_test_program "multi_open_unlink" _scratch_mkfs >>$seqres.full 2>&1 || _fail "mkfs failed" _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount mkdir $SCRATCH_MNT/testdir $here/src/multi_open_unlink -f $SCRATCH_MNT/testdir/foo -F -S -n 1 -s 0
@@ -43,7 +43,7 @@ _flakey_drop_and_remount # more hard links. ls $SCRATCH_MNT/testdir -_unmount_flakey +_scratch_unmount echo "Silence is golden" status=0
tests/generic/771 +1 -1
@@ -31,7 +31,7 @@ _require_dm_target flakey _scratch_mkfs >> $seqres.full 2>&1 || _fail "mkfs failed" _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # Create our first test file with some data. mkdir $SCRATCH_MNT/testdir
tests/generic/779 +2 -2
@@ -32,7 +32,7 @@ rm -f $seqres.full _scratch_mkfs >>$seqres.full 2>&1 || _fail "mkfs failed" _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # Create our test dir and add a symlink inside it. mkdir $SCRATCH_MNT/dir
@@ -54,7 +54,7 @@ _flakey_drop_and_remount [ -L $SCRATCH_MNT/dir/new-slink ] || echo "symlink dir/new-slink not found" echo "symlink content: $(readlink $SCRATCH_MNT/dir/new-slink)" -_unmount_flakey +_scratch_unmount # success, all done _exit 0
tests/generic/782 +2 -2
@@ -31,7 +31,7 @@ _require_dm_target flakey _scratch_mkfs >>$seqres.full 2>&1 || _fail "mkfs failed" _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # Create our test file. touch $SCRATCH_MNT/foo
@@ -68,6 +68,6 @@ ls -1 $SCRATCH_MNT | grep -v 'lost+found' echo "File data:" _hexdump $SCRATCH_MNT/foo -_unmount_flakey +_scratch_unmount _exit 0
tests/generic/784 +2 -2
@@ -31,7 +31,7 @@ _require_dm_target flakey _scratch_mkfs >>$seqres.full 2>&1 || _fail "mkfs failed" _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount list_fs_contents() {
@@ -70,7 +70,7 @@ _flakey_drop_and_remount echo -e "\nfs contents after power failure:\n" list_fs_contents -_unmount_flakey +_scratch_unmount # success, all done _exit 0
tests/generic/785 +2 -2
@@ -33,7 +33,7 @@ _require_fssum _scratch_mkfs >>$seqres.full 2>&1 || _fail "mkfs failed" _require_metadata_journaling $SCRATCH_DEV _init_flakey -_mount_flakey +_scratch_mount # Create our first test file. echo -n > $SCRATCH_MNT/file1
@@ -67,7 +67,7 @@ _flakey_drop_and_remount # failure and after the last fsync. $FSSUM_PROG -r $tmp.fssum $SCRATCH_MNT/ -_unmount_flakey +_scratch_unmount # success, all done _exit 0
tests/xfs/051 +2 -2
@@ -41,9 +41,9 @@ _kill_fsstress _scratch_unmount # Initialize a dm-flakey device that will pass I/Os for 5s and fail thereafter. -_init_flakey BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV` FLAKEY_TABLE="0 $BLK_DEV_SIZE flakey $SCRATCH_DEV 0 5 180" +_init_flakey _load_flakey_table $FLAKEY_ALLOW_WRITES # Set a 10s log recovery delay and mount the flakey device. This should allow
@@ -54,7 +54,7 @@ echo 10 > /sys/fs/xfs/debug/log_recovery_delay # The mount should fail due to dm-flakey. Note that this is dangerous on kernels # without the xfs_buf log recovery race fixes. -_mount_flakey > /dev/null 2>&1 +_scratch_mount > /dev/null 2>&1 echo 0 > /sys/fs/xfs/debug/log_recovery_delay
tests/xfs/438 +7 -4
@@ -32,7 +32,7 @@ _cleanup() sysctl -w fs.xfs.xfssyncd_centisecs=${interval} >/dev/null 2>&1 cd / rm -f $tmp.* - _unmount_flakey >/dev/null 2>&1 + _scratch_unmount >/dev/null 2>&1 _cleanup_flakey > /dev/null 2>&1 }
@@ -100,8 +100,12 @@ echo "Silence is golden" _scratch_mkfs > $seqres.full 2>&1 +# this needs to happen after mkfs, but before _init_flakey overrides SCRATCH_DEV +FLAKEY_TABLE_NON_LOG_ERROR=$(make_xfs_scratch_flakey_table) + # no error will be injected _init_flakey +FLAKEY_TABLE_ERROR=${FLAKEY_TABLE_NON_LOG_ERROR} $DMSETUP_PROG info >> $seqres.full $DMSETUP_PROG table >> $seqres.full
@@ -111,7 +115,7 @@ interval=$(sysctl -n fs.xfs.xfssyncd_centisecs 2>/dev/null) sysctl -w fs.xfs.xfssyncd_centisecs=100 >> $seqres.full 2>&1 _qmount_option "usrquota" -_mount_flakey +_scratch_mount # We need to set the quota limitation twice, and inject the write error # after the second setting. If we try to inject the write error after
@@ -127,7 +131,6 @@ xfs_freeze -f $SCRATCH_MNT xfs_freeze -u $SCRATCH_MNT # inject write IO error -FLAKEY_TABLE_ERROR=$(make_xfs_scratch_flakey_table) _load_flakey_table ${FLAKEY_ERROR_WRITES} $DMSETUP_PROG info >> $seqres.full $DMSETUP_PROG table >> $seqres.full
@@ -142,7 +145,7 @@ _scratch_sync # the completion of the retried write of dquota buffer sleep 2 -_unmount_flakey +_scratch_unmount _cleanup_flakey
tests/xfs/542 +2 -2
@@ -34,7 +34,7 @@ _require_flakey_with_error_writes _scratch_mkfs >> $seqres.full _init_flakey -_mount_flakey +_scratch_mount blksz=$(_get_file_block_size $SCRATCH_MNT)
@@ -61,7 +61,7 @@ _load_flakey_table $FLAKEY_ALLOW_WRITES # Try a post-fail reflink and then unmount. Both of these are known to produce # errors and/or assert failures on XFS if we trip over a stale delalloc block. _cp_reflink $SCRATCH_MNT/file2 $SCRATCH_MNT/file3 -_unmount_flakey +_scratch_unmount # success, all done status=0
tests/xfs/605 +5 -5
@@ -41,7 +41,7 @@ _scratch_mkfs >> $seqres.full 2>&1 echo "Initialize and mount filesystem on flakey device" _init_flakey _load_flakey_table $FLAKEY_ALLOW_WRITES -_mount_flakey +_scratch_mount echo "Create test file" $XFS_IO_PROG -s -f -c "pwrite 0 5M" $testfile >> $seqres.full
@@ -50,10 +50,10 @@ echo "Punch alternative blocks of test file" $here/src/punch-alternating $testfile echo "Mount cycle the filesystem on flakey device" -_unmount_flakey -_mount_flakey +_scratch_unmount +_scratch_mount -device=$(readlink -f $FLAKEY_DEV) +device=$(readlink -f $SCRATCH_DEV) device=$(_short_dev $device) echo "Pin log items in the AIL"
@@ -73,7 +73,7 @@ echo "Unpin log items in AIL" echo 0 > /sys/fs/xfs/${device}/errortag/log_item_pin echo "Unmount filesystem on flakey device" -_unmount_flakey +_scratch_unmount echo "Clean up flakey device" _cleanup_flakey
Signature · 1 line
2.47.3
Re: [PATCH 01/13] dmflakey: override SCRATCH_DEV in _init_flakey
Quoted 11 lines · Christoph Hellwig
_init_flakeyalready overridesSCRATCH_LOGDEVandSCRATCH_RTDEVso that the XFS-specific helpers work fine with external devices. Do the same forSCRATCH_DEVitself, so that_scratch_mountand_scratch_unmountjust work, and so that_check_scratch_fsdoes not need to override the main device.This requires some small adjustments in how generic/741 checks that mounting the underlying device fails, but the new version actually is simpler than the old one, and in xfs/438 where we need to be careful where to create the custom dm table.
Quoted 1 line
Signed-off-by Christoph Hellwig <[email protected]>
PATCH 2/13 ext4/006: call e2fsck directly
In reply to Christoph Hellwig_check_scratch_fs takes an optional device name, but no optional arguments. Call e2fsck directly for this extN-specific test instead.
--- tests/ext4/006 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/ext4/006 +1 -1
@@ -44,7 +44,7 @@ repair_scratch() { res=$? if [ "${res}" -eq 0 ]; then echo "++ allegedly fixed, reverify" >> "${FSCK_LOG}" - _check_scratch_fs -n >> "${FSCK_LOG}" 2>&1 + e2fsck -n "${SCRATCH_DEV}" >> "${FSCK_LOG}" 2>&1 res=$? fi echo "++ fsck returns ${res}" >> "${FSCK_LOG}"
Signature · 1 line
2.47.3
PATCH 3/13 common: add a _check_dev_fs helper
In reply to Christoph HellwigAdd a helper to run the file system checker for a given device, and stop overloading _check_scratch_fs with the optional device argument that creates complication around scratch RT and log devices.
--- common/dmthin | 6 +++++- common/rc | 21 +++++++++++++++++---- tests/btrfs/176 | 4 ++-- tests/generic/648 | 2 +- tests/xfs/601 | 2 +- 5 files changed, 26 insertions(+), 9 deletions(-)
common/dmthin +5 -1
@@ -33,7 +33,11 @@ _dmthin_cleanup() _dmthin_check_fs() { _unmount $SCRATCH_MNT > /dev/null 2>&1 - _check_scratch_fs $DMTHIN_VOL_DEV + OLD_SCRATCH_DEV=$SCRATCH_DEV + SCRATCH_DEV=$DMTHIN_VOL_DEV + _check_scratch_fs + SCRATCH_DEV=$OLD_SCRATCH_DEV + unset OLD_SCRATCH_DEV } # Set up a dm-thin device on $SCRATCH_DEV
common/rc +17 -4
@@ -3692,14 +3692,14 @@ _check_test_fs() esac } -_check_scratch_fs() +# check the file system passed in as $1 +_check_dev_fs() { - local device=$SCRATCH_DEV - [ $# -eq 1 ] && device=$1 + local device=$1 case $FSTYP in xfs) - _check_xfs_scratch_fs $device + _check_xfs_filesystem $device "none" "none" ;; udf) _check_udf_filesystem $device $udf_fsize
@@ -3751,6 +3751,19 @@ _check_scratch_fs() esac } +# check the scratch file system +_check_scratch_fs() +{ + case $FSTYP in + xfs) + _check_xfs_scratch_fs $SCRATCH_DEV + ;; + *) + _check_dev_fs $SCRATCH_DEV + ;; + esac +} + _full_fstyp_details() { [ -z "$FSTYP" ] && FSTYP=xfs
tests/btrfs/176 +2 -2
@@ -37,7 +37,7 @@ swapoff "$SCRATCH_MNT/swap" > /dev/null 2>&1 # Deleting device 1 should work again after swapoff. $BTRFS_UTIL_PROG device delete "$scratch_dev1" "$SCRATCH_MNT" _scratch_unmount -_check_scratch_fs "$scratch_dev2" +_check_dev_fs "$scratch_dev2" echo "Replace device" _scratch_mkfs >> $seqres.full 2>&1
@@ -55,7 +55,7 @@ swapoff "$SCRATCH_MNT/swap" > /dev/null 2>&1 $BTRFS_UTIL_PROG replace start -fB "$scratch_dev1" "$scratch_dev2" "$SCRATCH_MNT" \ >> $seqres.full _scratch_unmount -_check_scratch_fs "$scratch_dev2" +_check_dev_fs "$scratch_dev2" # success, all done status=0
tests/generic/648 +1 -1
@@ -133,7 +133,7 @@ if [ -f "$loopimg" ]; then _metadump_dev $DMERROR_DEV $seqres.scratch.final.md echo "final scratch mount failed" fi - SCRATCH_RTDEV= SCRATCH_LOGDEV= _check_scratch_fs $loopimg + _check_dev_fs $loopimg fi # success, all done; let the test harness check the scratch fs
tests/xfs/601 +1 -1
@@ -39,7 +39,7 @@ copy_file=$testdir/copy.img echo copy $XFS_COPY_PROG $SCRATCH_DEV $copy_file >> $seqres.full -_check_scratch_fs $copy_file +_check_dev_fs $copy_file echo recopy $XFS_COPY_PROG $copy_file $SCRATCH_DEV >> $seqres.full
Signature · 1 line
2.47.3
PATCH 4/13 ext4/032: use _check_dev_fs
In reply to Christoph Hellwig_check_dev_fs is the new designated helper to check file systems on arbitrary devices, use that instead of _check_generic_filesystem, which is just an implementation detail.
--- tests/ext4/032 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/ext4/032 +1 -1
@@ -66,7 +66,7 @@ ext4_online_resize() $UMOUNT_PROG ${IMG_MNT} echo "+++ check fs" | tee -a $seqres.full - _check_generic_filesystem $LOOP_DEVICE >> $seqres.full 2>&1 || \ + _check_dev_fs $LOOP_DEVICE >> $seqres.full 2>&1 || \ _fail "fsck should not fail" _destroy_loop_device $LOOP_DEVICE && LOOP_DEVICE= }
Signature · 1 line
2.47.3
PATCH 5/13 generic/590: split XFS RT specific bits out
In reply to Christoph HellwigCurrently generic/590 runs a very different test on XFS that creates a lot device and so on. Split that out into a new XFS-specific test, and let generic/590 always run using the file system parameter specified in the config even for XFS.
--- tests/generic/590 | 68 ++------------------------- tests/xfs/650 | 117 ++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/650.out | 2 + 3 files changed, 123 insertions(+), 64 deletions(-) create mode 100755 tests/xfs/650 create mode 100644 tests/xfs/650.out
tests/generic/590 +4 -64
@@ -4,27 +4,15 @@ # # FS QA Test 590 # -# Test commit 0c4da70c83d4 ("xfs: fix realtime file data space leak") and -# 69ffe5960df1 ("xfs: don't check for AG deadlock for realtime files in -# bunmapi"). On XFS without the fixes, truncate will hang forever. On other -# filesystems, this just tests writing into big fallocates. +# Tests writing into big fallocates. +# +# Based on an XFS RT subvolume specific test now split into xfs/650. # . ./common/preamble _begin_fstest auto prealloc preallocrw -# Override the default cleanup function. -_cleanup() -{ - _scratch_unmount &>/dev/null - [ -n "$loop_dev" ] && _destroy_loop_device $loop_dev - cd / - rm -f $tmp.* - rm -f "$TEST_DIR/$seq" -} - . ./common/filter -_require_scratch_nocheck _require_xfs_io_command "falloc" maxextlen=$((0x1fffff))
@@ -32,54 +20,7 @@ bs=4096 rextsize=4 filesz=$(((maxextlen + 1) * bs)) -must_disable_feature() { - local feat="$1" - - # If mkfs doesn't know about the feature, we don't need to disable it - $MKFS_XFS_PROG --help 2>&1 | grep -q "${feat}=0" || return 1 - - # If turning the feature on works, we don't need to disable it - _scratch_mkfs_xfs_supported -m "${feat}=1" "${disabled_features[@]}" \ - > /dev/null 2>&1 && return 1 - - # Otherwise mkfs knows of the feature and formatting with it failed, - # so we do need to mask it. - return 0 -} - -extra_options="" -# If we're testing XFS, set up the realtime device to reproduce the bug. -if [[ $FSTYP = xfs ]]; then - # If we don't have a realtime device, set up a loop device on the test - # filesystem. - if [[ $USE_EXTERNAL != yes || -z $SCRATCH_RTDEV ]]; then - _require_test - loopsz="$((filesz + (1 << 26)))" - _require_fs_space "$TEST_DIR" $((loopsz / 1024)) - $XFS_IO_PROG -c "truncate $loopsz" -f "$TEST_DIR/$seq" - loop_dev="$(_create_loop_device "$TEST_DIR/$seq")" - USE_EXTERNAL=yes - SCRATCH_RTDEV="$loop_dev" - disabled_features=() - - # disable reflink if not supported by realtime devices - must_disable_feature reflink && - disabled_features=(-m reflink=0) - - # disable rmap if not supported by realtime devices - must_disable_feature rmapbt && - disabled_features+=(-m rmapbt=0) - fi - extra_options="$extra_options -r extsize=$((bs * rextsize))" - extra_options="$extra_options -d agsize=$(((maxextlen + 1) * bs / 2)),rtinherit=1" - - _scratch_mkfs $extra_options "${disabled_features[@]}" >>$seqres.full 2>&1 - _try_scratch_mount >>$seqres.full 2>&1 || \ - _notrun "mount failed, kernel doesn't support realtime?" - _scratch_unmount -else - _scratch_mkfs $extra_options >>$seqres.full 2>&1 -fi +_scratch_mkfs >>$seqres.full 2>&1 _scratch_mount _require_fs_space "$SCRATCH_MNT" $((filesz / 1024))
@@ -112,7 +53,6 @@ $XFS_IO_PROG -c "pwrite -b 1M -W 0 $(((maxextlen + 2 - rextsize) * bs))" \ # Truncate the extents. $XFS_IO_PROG -c "truncate 0" -c fsync "$SCRATCH_MNT/file" -# We need to do this before the loop device gets torn down. _scratch_unmount _check_scratch_fs
tests/xfs/650 new file +117 -0
117 lines not on this page · raw message
tests/xfs/650.out new file +2 -0
@@ -0,0 +1,2 @@ +QA output created by 650 +Silence is golden
Signature · 1 line
2.47.3
PATCH 6/13 xfs/157: don't override SCRATCH_{,LOG,RT}DEV
In reply to Christoph HellwigThis tests wants to test various difference device configurations, and does so by overriding SCRATCH_{,LOG,RT}DEV. This has two downside:
1) the actual SCRATCH_{,LOG,RT}DEV configuration is still injected by default, thus making the test dependent on that configuration
2) the MKFS_OPTIONS might not actually be compatible with the configuration created
Fix this by open coding the mkfs, db, admin and repair calls and always run them on the specific configuration.
--- tests/xfs/157 | 104 +++++++++++++++++++++++++++++++++++++------------- 1 file changed, 78 insertions(+), 26 deletions(-)
tests/xfs/157 +78 -26
@@ -50,53 +50,105 @@ fake_rtfile=$TEST_DIR/$seq.scratch.rt rm -f $fake_rtfile truncate -s $fs_size $fake_rtfile -# Save the original variables -orig_ddev=$SCRATCH_DEV -orig_external=$USE_EXTERNAL -orig_logdev=$SCRATCH_LOGDEV -orig_rtdev=$SCRATCH_RTDEV - scenario() { echo "$@" | tee -a $seqres.full - SCRATCH_DEV=$orig_ddev - USE_EXTERNAL=$orig_external - SCRATCH_LOGDEV=$orig_logdev - SCRATCH_RTDEV=$orig_rtdev + dev=$SCRATCH_DEV + logdev= + rtdev= +} + +_fake_mkfs() +{ + OPTIONS="$*" + if [ -n "$logdev" ]; then + OPTIONS="$OPTIONS -l logdev=$logdev" + fi + if [ -n "$rtdev" ]; then + OPTIONS="$OPTIONS -r rtdev=$rtdev" + fi + $MKFS_XFS_PROG -f $OPTIONS $dev || _fail "mkfs failed" +} + +_fake_xfs_db_options() +{ + OPTIONS="" + if [ ! -z "$logdev" ]; then + OPTIONS="-l $logdev" + fi + if [ ! -z "$rtdev" ]; then + if [ $XFS_DB_PROG --help 2>&1 | grep -q -- '-R rtdev']; then + OPTIONS="$OPTIONS -R $rtdev" + fi + fi + echo $OPTIONS $* $dev +} + +_fake_xfs_db() +{ + $XFS_DB_PROG "$@" $(_fake_xfs_db_options) +} + +_fake_xfs_admin() +{ + local options=("$dev") + local rt_opts=() + if [ -n "$logdev" ]; then + options+=("$logdev") + fi + if [ -n "$rtdev" ]; then + $XFS_ADMIN_PROG --help 2>&1 | grep -q 'rtdev' || \ + _notrun 'xfs_admin does not support rt devices' + rt_opts+=(-r "$rtdev") + fi + + # xfs_admin in xfsprogs 5.11 has a bug where an external log device + # forces xfs_db to be invoked, potentially with zero command arguments. + # When this happens, xfs_db will wait for input on stdin, which causes + # fstests to hang. Since xfs_admin is not an interactive tool, we + # can redirect stdin from /dev/null to prevent this issue. + $XFS_ADMIN_PROG "${rt_opts[@]}" "$@" "${options[@]}" < /dev/null +} + + +_fake_xfs_repair() +{ + OPTIONS="" + if [ -n "$logdev" ]; then + OPTIONS="-l $logdev" + fi + if [ -n "$rtdev" ]; then + OPTIONS="$OPTIONS -r $rtdev" + fi + $XFS_REPAIR_PROG $OPTIONS $* $dev } check_label() { - _scratch_mkfs_sized "$fs_size" "" -L oldlabel >> $seqres.full 2>&1 - _scratch_xfs_db -c label - _scratch_xfs_admin -L newlabel "$@" >> $seqres.full - _scratch_xfs_db -c label - _scratch_xfs_repair -n &>> $seqres.full || echo "Check failed?" + _fake_mkfs -L oldlabel >> $seqres.full 2>&1 + _fake_xfs_db -c label + _fake_xfs_admin -L newlabel "$@" >> $seqres.full + _fake_xfs_db -c label + _fake_xfs_repair -n &>> $seqres.full || echo "Check failed?" } scenario "S1: Check that label setting with file image" -SCRATCH_DEV=$fake_datafile +dev=$fake_datafile check_label -f scenario "S2: Check that setting with logdev works" -USE_EXTERNAL=yes -SCRATCH_LOGDEV=$fake_logfile +logdev=$fake_logfile check_label scenario "S3: Check that setting with rtdev works" -USE_EXTERNAL=yes -SCRATCH_RTDEV=$fake_rtfile +rtdev=$fake_rtfile check_label scenario "S4: Check that setting with rtdev + logdev works" -USE_EXTERNAL=yes -SCRATCH_LOGDEV=$fake_logfile -SCRATCH_RTDEV=$fake_rtfile +logdev=$fake_logfile +rtdev=$fake_rtfile check_label scenario "S5: Check that setting with nortdev + nologdev works" -USE_EXTERNAL= -SCRATCH_LOGDEV= -SCRATCH_RTDEV= check_label scenario "S6: Check that setting with bdev incorrectly flagged as file works"
Signature · 1 line
2.47.3
PATCH 7/13 xfs/185: don't use SCRATCH_{,RT}DEV helpers
In reply to Christoph HellwigThis tests creates loop-based data and rt devices for testing. Don't override SCRATCH_{,RT}DEV and don't use the helpers based on it because the options specified in MKFS_OPTIONS might not work for this configuration. This also means that we will now never use a log device for this test even if SCRATCH_LOGDEV was set, which is fine because the log device is not relevant for what is tested.
--- tests/xfs/185 | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-)
tests/xfs/185 +3 -12
@@ -22,12 +22,11 @@ _cleanup() { cd / rm -r -f $tmp.* - _scratch_unmount + umount $SCRATCH_MNT test -n "$ddloop" && _destroy_loop_device "$ddloop" test -n "$rtloop" && _destroy_loop_device "$rtloop" test -n "$ddfile" && rm -f "$ddfile" test -n "$rtfile" && rm -f "$rtfile" - test -n "$old_use_external" && USE_EXTERNAL="$old_use_external" } _require_test
@@ -64,16 +63,8 @@ rtminor=$(stat -c '%T' "$rtloop") test $ddmajor -le $rtmajor || \ _notrun "Data loopdev minor $ddminor larger than rt minor $rtminor" -# Inject our custom-built devices as an rt-capable scratch device. -# We avoid touching "require_scratch" so that post-test fsck will not try to -# run on our synthesized scratch device. -old_use_external="$USE_EXTERNAL" -USE_EXTERNAL=yes -SCRATCH_RTDEV="$rtloop" -SCRATCH_DEV="$ddloop" - -_scratch_mkfs >> $seqres.full -_try_scratch_mount >> $seqres.full || \ +$MKFS_XFS_PROG -r rtdev=$rtloop $ddloop >> $seqres.full +mount -o rtdev=$rtloop $ddloop $SCRATCH_MNT >> $seqres.full || \ _notrun "mount with injected rt device failed" # Create a file that we'll use to seed fsmap entries for the rt device,
Signature · 1 line
2.47.3
PATCH 8/13 xfs/424: don't use SCRATCH_DEV helpers
In reply to Christoph HellwigThis tests forces external devices to be disabled by calling mkfs.xfs directly and overriding SCRATCH_{LOG,RT}DEV, but the options specified in MKFS_OPTIONS might not work for this configuration. Instead hard code the calls to xfs_db and don't modify the scratch device configuration.
--- tests/xfs/424 | 41 ++++++++++++++++++----------------------- 1 file changed, 18 insertions(+), 23 deletions(-)
tests/xfs/424 +18 -23
@@ -25,17 +25,11 @@ filter_dbval() awk '{ print $4 }' } -# Import common functions. . ./common/filter -# Modify as appropriate - -# Since we have an open-coded mkfs call, disable the external devices and -# don't let the post-check fsck actually run since it'll trip over us not -# using the external devices. +# Since we have an open-coded mkfs call, don't let the post-check fsck run since +# it would trip over us not using the external devices. _require_scratch_nocheck -export SCRATCH_LOGDEV= -export SCRATCH_RTDEV= echo "Silence is golden."
@@ -62,30 +56,31 @@ for SECTOR_SIZE in $sector_sizes; do grep -q 'finobt=1' && finobt_enabled=1 for TYPE in agf agi agfl sb; do - DADDR=`_scratch_xfs_db -c "$TYPE" -c "daddr" | filter_dbval` - _scratch_xfs_db -c "daddr $DADDR" -c "type $TYPE" + DADDR=`$XFS_DB_PROG -c "$TYPE" -c "daddr" $SCRATCH_DEV | + filter_dbval` + $XFS_DB_PROG -c "daddr $DADDR" -c "type $TYPE" $SCRATCH_DEV done - DADDR=`_scratch_xfs_db -c "sb" -c "addr rootino" -c "daddr" | + DADDR=`$XFS_DB_PROG -c "sb" -c "addr rootino" -c "daddr" $SCRATCH_DEV | filter_dbval` - _scratch_xfs_db -c "daddr $DADDR" -c "type inode" - DADDR=`_scratch_xfs_db -c "agf" -c "addr bnoroot" -c "daddr" | + $XFS_DB_PROG -c "daddr $DADDR" -c "type inode" $SCRATCH_DEV + DADDR=`$XFS_DB_PROG -c "agf" -c "addr bnoroot" -c "daddr" $SCRATCH_DEV | filter_dbval` - _scratch_xfs_db -c "daddr $DADDR" -c "type bnobt" - DADDR=`_scratch_xfs_db -c "agf" -c "addr cntroot" -c "daddr" | + $XFS_DB_PROG -c "daddr $DADDR" -c "type bnobt" $SCRATCH_DEV + DADDR=`$XFS_DB_PROG -c "agf" -c "addr cntroot" -c "daddr" $SCRATCH_DEV | filter_dbval` - _scratch_xfs_db -c "daddr $DADDR" -c "type cntbt" - DADDR=`_scratch_xfs_db -c "agi" -c "addr root" -c "daddr" | + $XFS_DB_PROG -c "daddr $DADDR" -c "type cntbt" $SCRATCH_DEV + DADDR=`$XFS_DB_PROG -c "agi" -c "addr root" -c "daddr" $SCRATCH_DEV | filter_dbval` - _scratch_xfs_db -c "daddr $DADDR" -c "type inobt" + $XFS_DB_PROG -c "daddr $DADDR" -c "type inobt" $SCRATCH_DEV if [ $finobt_enabled -eq 1 ]; then - DADDR=`_scratch_xfs_db -c "agi" -c "addr free_root" -c "daddr" | - filter_dbval` - _scratch_xfs_db -c "daddr $DADDR" -c "type finobt" + DADDR=`$XFS_DB_PROG -c "agi" -c "addr free_root" -c "daddr" $SCRATCH_DEV | + filter_dbval` + $XFS_DB_PROG -c "daddr $DADDR" -c "type finobt" $SCRATCH_DEV fi - _scratch_xfs_db -c "daddr $DADDR" -c "type text" - _scratch_xfs_db -c "daddr $DADDR" -c "type data" + $XFS_DB_PROG -c "daddr $DADDR" -c "type text" $SCRATCH_DEV + $XFS_DB_PROG -c "daddr $DADDR" -c "type data" $SCRATCH_DEV done # success, all done
Signature · 1 line
2.47.3
PATCH 9/13 xfs/521: require a real SCRATCH_RTDEV
In reply to Christoph HellwigRequire a real SCRATCH_RTDEV instead of faking one up using a loop device, as otherwise the options specified in MKFS_OPTIONS might not actually work the configuration.
--- tests/xfs/521 | 33 ++++++++------------------------- tests/xfs/521.out | 1 - 2 files changed, 8 insertions(+), 26 deletions(-)
tests/xfs/521 +8 -25
@@ -16,34 +16,16 @@ . ./common/preamble _begin_fstest auto quick realtime growfs -# Override the default cleanup function. -_cleanup() -{ - cd / - _scratch_unmount >> $seqres.full 2>&1 - [ -n "$rt_loop_dev" ] && _destroy_loop_device $rt_loop_dev - rm -f $tmp.* $TEST_DIR/$seq.rtvol -} - -# Import common functions. . ./common/filter -# Note that we don't _require_realtime because we synthesize a rt volume -# below. -_require_scratch_nocheck -_require_no_large_scratch_dev - -echo "Create fake rt volume" -truncate -s 400m $TEST_DIR/$seq.rtvol -rt_loop_dev=$(_create_loop_device $TEST_DIR/$seq.rtvol) +_require_realtime +_require_scratch echo "Format and mount 100m rt volume" -export USE_EXTERNAL=yes -export SCRATCH_RTDEV=$rtdev _scratch_mkfs -r size=100m > $seqres.full -_try_scratch_mount || _notrun "Could not mount scratch with synthetic rt volume" +_scratch_mount -# zoned file systems only support zoned size-rounded RT device sizes +# zoned file systems only support zone-size aligned RT device sizes _require_xfs_scratch_non_zoned testdir=$SCRATCH_MNT/test-$seq
@@ -58,7 +40,10 @@ echo "Create some files" _pwrite_byte 0x61 0 1m $testdir/original >> $seqres.full echo "Grow fs" -$XFS_GROWFS_PROG $SCRATCH_MNT 2>&1 | _filter_growfs >> $seqres.full +# growfs expects sizes in FSB units +fsbsize=$(_get_block_size $SCRATCH_MNT) +$XFS_GROWFS_PROG -R $((400 * 1024 * 1024 / fsbsize)) $SCRATCH_MNT 2>&1 | \ + _filter_growfs >> $seqres.full _scratch_cycle_mount echo "Recheck 400m rt volume stats"
@@ -73,8 +58,6 @@ echo "Check filesystem" _check_scratch_fs _scratch_unmount -_destroy_loop_device $rt_loop_dev -unset rt_loop_dev # success, all done status=0
tests/xfs/521.out +0 -1
@@ -1,5 +1,4 @@ QA output created by 521 -Create fake rt volume Format and mount 100m rt volume Check rt volume stats Create some files
Signature · 1 line
2.47.3
PATCH 10/13 xfs/521: call _require_scratch_size
In reply to Christoph HellwigThis tests expects to have at least 400M on the scratch device. Ensure that, even if test runs with small devices will probably break in all kinds of other funny ways.
--- tests/xfs/521 | 1 + 1 file changed, 1 insertion(+)
tests/xfs/521 +1 -0
@@ -20,6 +20,7 @@ _begin_fstest auto quick realtime growfs _require_realtime _require_scratch +_require_scratch_size $((400 * 1024)) echo "Format and mount 100m rt volume" _scratch_mkfs -r size=100m > $seqres.full
Signature · 1 line
2.47.3
PATCH 11/13 xfs/528: require a real SCRATCH_RTDEV
In reply to Christoph HellwigRequire a real SCRATCH_RTDEV instead of faking one up using a loop device, as otherwise the options specified in MKFS_OPTIONS might not actually work the configuration.
--- tests/xfs/528 | 34 ++++------------------------------ tests/xfs/528.out | 2 -- 2 files changed, 4 insertions(+), 32 deletions(-)
tests/xfs/528 +4 -30
@@ -10,27 +10,16 @@ . ./common/preamble _begin_fstest auto quick insert zero collapse punch rw realtime -# Override the default cleanup function. -_cleanup() -{ - cd / - _scratch_unmount >> $seqres.full 2>&1 - [ -n "$rt_loop_dev" ] && _destroy_loop_device $rt_loop_dev - rm -f $tmp.* $TEST_DIR/$seq.rtvol -} - -# Import common functions. . ./common/filter -_require_loop _require_command "$FILEFRAG_PROG" filefrag _require_xfs_io_command "fpunch" _require_xfs_io_command "fzero" _require_xfs_io_command "fcollapse" _require_xfs_io_command "finsert" -# Note that we don't _require_realtime because we synthesize a rt volume -# below. This also means we cannot run the post-test check. -_require_scratch_nocheck + +_require_realtime +_require_scratch log() { echo "$@" | tee -a $seqres.full
@@ -63,7 +52,6 @@ test_ops() { local lunaligned_off=$unaligned_sz log "Format rtextsize=$rextsize" - _scratch_unmount _scratch_mkfs -r extsize=$rextsize >> $seqres.full _try_scratch_mount || \ _notrun "Could not mount rextsize=$rextsize with synthetic rt volume"
@@ -151,29 +139,15 @@ test_ops() { log "Check everything, rextsize=$rextsize" _check_scratch_fs + _scratch_unmount } -echo "Create fake rt volume" -$XFS_IO_PROG -f -c "truncate 400m" $TEST_DIR/$seq.rtvol -rt_loop_dev=$(_create_loop_device $TEST_DIR/$seq.rtvol) - -echo "Make sure synth rt volume works" -export USE_EXTERNAL=yes -export SCRATCH_RTDEV=$rt_loop_dev -_scratch_mkfs > $seqres.full -_try_scratch_mount || \ - _notrun "Could not mount with synthetic rt volume" - # power of two test_ops 262144 # not a power of two test_ops 327680 -_scratch_unmount -_destroy_loop_device $rt_loop_dev -unset rt_loop_dev - # success, all done status=0 exit
tests/xfs/528.out +0 -2
@@ -1,6 +1,4 @@ QA output created by 528 -Create fake rt volume -Make sure synth rt volume works Format rtextsize=262144 Test regular write, rextsize=262144 2dce060217cb2293dde96f7fdb3b9232 SCRATCH_MNT/write
Signature · 1 line
2.47.3
PATCH 12/13 xfs/530: require a real SCRATCH_RTDEV
In reply to Christoph HellwigRequire a real SCRATCH_RTDEV instead of faking one up using a loop device, as otherwise the options specified in MKFS_OPTIONS might not actually work the configuration.
Note that specifying a rtextsize doesn't work for zoned file systems, so _notrun when mkfs fails.
--- tests/xfs/530 | 42 +++++++++++++----------------------------- tests/xfs/530.out | 1 - 2 files changed, 13 insertions(+), 30 deletions(-)
tests/xfs/530 +13 -29
@@ -10,36 +10,22 @@ . ./common/preamble _begin_fstest auto quick realtime growfs -# Override the default cleanup function. -_cleanup() -{ - cd / - _scratch_unmount >> $seqres.full 2>&1 - [ -n "$rt_loop_dev" ] && _destroy_loop_device $rt_loop_dev - rm -f $tmp.* $TEST_DIR/$seq.rtvol -} - -# Import common functions. . ./common/filter . ./common/inject . ./common/populate - -# Note that we don't _require_realtime because we synthesize a rt volume -# below. -_require_test +_require_scratch +_require_realtime _require_xfs_debug _require_test_program "punch-alternating" _require_xfs_io_error_injection "reduce_max_iextents" _require_xfs_io_error_injection "bmap_alloc_minlen_extent" -_require_scratch_nocheck echo "* Test extending rt inodes" _scratch_mkfs | _filter_mkfs >> $seqres.full 2> $tmp.mkfs . $tmp.mkfs -echo "Create fake rt volume" nr_bitmap_blks=25 nr_bits=$((nr_bitmap_blks * dbsize * 8))
@@ -50,17 +36,12 @@ else rtextsz=$dbsize fi -rtdevsz=$((nr_bits * rtextsz)) -truncate -s $rtdevsz $TEST_DIR/$seq.rtvol -rt_loop_dev=$(_create_loop_device $TEST_DIR/$seq.rtvol) - echo "Format and mount rt volume" - -export USE_EXTERNAL=yes -export SCRATCH_RTDEV=$rt_loop_dev -_scratch_mkfs -d size=$((1024 * 1024 * 1024)) \ - -r size=${rtextsz},extsize=${rtextsz} >> $seqres.full -_try_scratch_mount || _notrun "Couldn't mount fs with synthetic rt volume" +_try_scratch_mkfs_xfs \ + -d size=$((1024 * 1024 * 1024)) \ + -r size=${rtextsz},extsize=${rtextsz} >> $seqres.full 2>&1 || \ + _notrun "Couldn't created crafted fs (zoned?)" +_try_scratch_mount || _notrun "Couldn't mount crafted fs" # If we didn't get the desired realtime volume and the same blocksize as the # first format (which we used to compute a specific rt geometry), skip the
@@ -92,7 +73,12 @@ echo "Inject bmap_alloc_minlen_extent error tag" _scratch_inject_error bmap_alloc_minlen_extent 1 echo "Grow realtime volume" -$XFS_GROWFS_PROG -r $SCRATCH_MNT >> $seqres.full 2>&1 +# growfs expects sizes in FSB units +fsbsize=$(_get_block_size $SCRATCH_MNT) +rtdevsz=$((nr_bits * rtextsz)) + +$XFS_GROWFS_PROG -R $((rtdevsize / fsbsize)) $SCRATCH_MNT \ + >> $seqres.full 2>&1 if [[ $? == 0 ]]; then echo "Growfs succeeded; should have failed." exit 1
@@ -115,8 +101,6 @@ echo "Check filesystem" _check_scratch_fs _scratch_unmount &> /dev/null -_destroy_loop_device $rt_loop_dev -unset rt_loop_dev # success, all done status=0
tests/xfs/530.out +0 -1
@@ -1,6 +1,5 @@ QA output created by 530 * Test extending rt inodes -Create fake rt volume Format and mount rt volume Consume free space Create fragmented filesystem
Signature · 1 line
2.47.3
PATCH 13/13 xfs/650: require a real SCRATCH_RTDEV
In reply to Christoph HellwigRequire a real SCRATCH_RTDEV instead of faking one up using a loop device, as otherwise the options specified in MKFS_OPTIONS might not actually work the configuration.
--- tests/xfs/650 | 63 +++++---------------------------------------------- 1 file changed, 6 insertions(+), 57 deletions(-)
tests/xfs/650 +6 -57
@@ -9,21 +9,11 @@ # bunmapi"). On XFS without the fixes, truncate will hang forever. # . ./common/preamble -_begin_fstest auto prealloc preallocrw - -# Override the default cleanup function. -_cleanup() -{ - _scratch_unmount &>/dev/null - [ -n "$loop_dev" ] && _destroy_loop_device $loop_dev - cd / - rm -f $tmp.* - rm -f "$TEST_DIR/$seq" -} +_begin_fstest auto prealloc preallocrw realtime . ./common/filter -_require_scratch_nocheck +_require_realtime _require_xfs_io_command "falloc" maxextlen=$((0x1fffff))
@@ -31,51 +21,11 @@ bs=4096 rextsize=4 filesz=$(((maxextlen + 1) * bs)) -must_disable_feature() { - local feat="$1" - - # If mkfs doesn't know about the feature, we don't need to disable it - $MKFS_XFS_PROG --help 2>&1 | grep -q "${feat}=0" || return 1 - - # If turning the feature on works, we don't need to disable it - _scratch_mkfs_xfs_supported -m "${feat}=1" "${disabled_features[@]}" \ - > /dev/null 2>&1 && return 1 - - # Otherwise mkfs knows of the feature and formatting with it failed, - # so we do need to mask it. - return 0 -} - -extra_options="" -# Set up the realtime device to reproduce the bug. +_scratch_mkfs \ + -d agsize=$(((maxextlen + 1) * bs / 2)),rtinherit=1 \ + -r extsize=$((bs * rextsize)) \ + >>$seqres.full 2>&1 -# If we don't have a realtime device, set up a loop device on the test -# filesystem. -if [[ $USE_EXTERNAL != yes || -z $SCRATCH_RTDEV ]]; then - _require_test - loopsz="$((filesz + (1 << 26)))" - _require_fs_space "$TEST_DIR" $((loopsz / 1024)) - $XFS_IO_PROG -c "truncate $loopsz" -f "$TEST_DIR/$seq" - loop_dev="$(_create_loop_device "$TEST_DIR/$seq")" - USE_EXTERNAL=yes - SCRATCH_RTDEV="$loop_dev" - disabled_features=() - - # disable reflink if not supported by realtime devices - must_disable_feature reflink && - disabled_features=(-m reflink=0) - - # disable rmap if not supported by realtime devices - must_disable_feature rmapbt && - disabled_features+=(-m rmapbt=0) -fi -extra_options="$extra_options -r extsize=$((bs * rextsize))" -extra_options="$extra_options -d agsize=$(((maxextlen + 1) * bs / 2)),rtinherit=1" - -_scratch_mkfs $extra_options "${disabled_features[@]}" >>$seqres.full 2>&1 -_try_scratch_mount >>$seqres.full 2>&1 || \ - _notrun "mount failed, kernel doesn't support realtime?" -_scratch_unmount _scratch_mount _require_fs_space "$SCRATCH_MNT" $((filesz / 1024))
@@ -108,7 +58,6 @@ $XFS_IO_PROG -c "pwrite -b 1M -W 0 $(((maxextlen + 2 - rextsize) * bs))" \ # Truncate the extents. $XFS_IO_PROG -c "truncate 0" -c fsync "$SCRATCH_MNT/file" -# We need to do this before the loop device gets torn down. _scratch_unmount _check_scratch_fs
Signature · 1 line
2.47.3