]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
dmflakey: override SCRATCH_DEV in _init_flakey
authorChristoph Hellwig <hch@lst.de>
Thu, 18 Dec 2025 07:29:59 +0000 (08:29 +0100)
committerZorro Lang <zlang@kernel.org>
Wed, 31 Dec 2025 21:02:23 +0000 (05:02 +0800)
_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.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Anand Jain <asj@kernel.org>
Signed-off-by: Zorro Lang <zlang@kernel.org>
86 files changed:
common/dmflakey
tests/btrfs/056
tests/btrfs/085
tests/btrfs/095
tests/btrfs/098
tests/btrfs/118
tests/btrfs/119
tests/btrfs/120
tests/btrfs/159
tests/btrfs/166
tests/btrfs/201
tests/btrfs/209
tests/btrfs/211
tests/btrfs/231
tests/btrfs/233
tests/btrfs/236
tests/btrfs/239
tests/btrfs/240
tests/btrfs/243
tests/generic/034
tests/generic/039
tests/generic/040
tests/generic/041
tests/generic/056
tests/generic/057
tests/generic/059
tests/generic/065
tests/generic/066
tests/generic/073
tests/generic/090
tests/generic/101
tests/generic/104
tests/generic/106
tests/generic/107
tests/generic/177
tests/generic/311
tests/generic/321
tests/generic/322
tests/generic/325
tests/generic/335
tests/generic/336
tests/generic/341
tests/generic/342
tests/generic/343
tests/generic/348
tests/generic/376
tests/generic/456
tests/generic/479
tests/generic/480
tests/generic/481
tests/generic/483
tests/generic/489
tests/generic/498
tests/generic/501
tests/generic/502
tests/generic/509
tests/generic/510
tests/generic/512
tests/generic/520
tests/generic/526
tests/generic/527
tests/generic/534
tests/generic/535
tests/generic/546
tests/generic/547
tests/generic/552
tests/generic/557
tests/generic/588
tests/generic/640
tests/generic/677
tests/generic/690
tests/generic/695
tests/generic/703
tests/generic/741
tests/generic/741.out
tests/generic/745
tests/generic/764
tests/generic/771
tests/generic/779
tests/generic/782
tests/generic/784
tests/generic/785
tests/xfs/051
tests/xfs/438
tests/xfs/542
tests/xfs/605

index 7368a3e5b32420cce628520b36e30a72c4f9d55b..cb0359901c1637725008aab834c826f0a425ce4f 100644 (file)
@@ -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
 }
index f7557f4a41a60a0021a01ac7af59a352a32b0b40..08f9aac66789f09d7eba8195cf269a3177861860 100755 (executable)
@@ -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"
index 291bb8af042343d9e9ae7ce949353141f231cfca..8076329c4a5993b1575da153cbf55961a0e640e2 100755 (executable)
@@ -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"
index de34d64b7b92cbbd52cc4a323e684110e5a93edd..6ded7380b91221f5909651b4a12cc90da8881ec6 100755 (executable)
@@ -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
index 6ee0b9101d0f0317a62b51b86ec44850860c2a6d..a8b5cca8b582808f31fa9da45fa4625bc3cfe6d5 100755 (executable)
@@ -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
index d653983792950ce6f699d3070068cc99029228da..ec6fef2e7922f27f80f0338b690369137e69907f 100755 (executable)
@@ -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"
 
index a934ad634bf81d6ec9d29db1980b5c88683ede18..1982ae33970e4d2eb6a77044f5aa31f07ee72541 100755 (executable)
@@ -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
index a9b8adecfc9d81e4b1d9ff0ccb9b441dec771b74..efbac5883e10512f94ab41862400ed8816a1b9f8 100755 (executable)
@@ -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
index 5776523803276101de656a570392d9c8872fc90f..3a9051b1f4396f0054c8a680115a5a4cb2f2ec76 100755 (executable)
@@ -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
 }
 
index 719e2a3b6b92bc871c9995238fc2abcd3cfdca46..79b8ea0d84c8be63a645e92d2dffb2c9ff65ecf4 100755 (executable)
@@ -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"
index eb727cd23cd6cf70be954f5a80ea9f13c38ab77f..50262086fbbef03b0a469e5789cd5ce7ce25a365 100755 (executable)
@@ -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
 }
 
index 7318f8ae8bccaece516feb18ef9a1f76b1876bcf..bd98b635015993be517b3ceef20b5fe2135318c6 100755 (executable)
@@ -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
index 0127149109c416dbaf495a414470e8e1eaadf9c6..38dbadf9f0f324a3cb55d3dc88a8a6e941d822ab 100755 (executable)
@@ -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
index d9d0115000e4ac39d34b1d43d071402d6364e93c..5ebb2fdd753d002b9b0273a8642fff680ef3ac89 100755 (executable)
@@ -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
index 6c7cdc9a704031ad9cc8d763d3145bf7f9685c8f..2966566242e184c8a5ff8a814a277634df9b8416 100755 (executable)
@@ -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
index a3b58f0cd63678bb42bcecf876574104b6f16750..fd2fea85df4498b7b40181db29d6c5ff7db4d078 100755 (executable)
@@ -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"
index 3ac490273e660b7cf5b407b2d517e15810a2eac5..834785fa980f644fdcd21a7a041d93b28a0a7d2a 100755 (executable)
@@ -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
index 6ad7adc11f1ec6ef0fec49021a19b1fb57f0432f..c9d7cbb354058d9729d3945574582867ebe2cbb2 100755 (executable)
@@ -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
index 6e0649fbcf2cc6ee3bfe2c6d44a08fe3150c3feb..46f3066ef34b53116680d2336cf9dc2190a45e97 100755 (executable)
@@ -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
index cd22f330d77c95942a147178b04f41fec389e4c4..45fd234487a12b10e74cbaf24ccf1269563659e7 100755 (executable)
@@ -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"
 
index 00d4e4afb5fc60b3c55d1633e0b916d615d38a0e..2647085431972d550e9e19cca9a0a2c999e18ee5 100755 (executable)
@@ -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
index 8b4e3b703a4e4f6041e000a4b5d3ec1b9b18ad29..acc3689aa697829c9792caa4879fe0cbfad0fea7 100755 (executable)
@@ -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
index 6d42d1a283103caf9cf36b84e41fe3b44b418fc4..79612397e59047fc5a56cb937258aabee5044d64 100755 (executable)
@@ -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
index 3e139e1ea48cf64a1d98e571526edafdda0fb225..20302622dc05175802020b75ca6694c22d2989f4 100755 (executable)
@@ -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
index c5db80977b4dafbc7dead2e1bcde5629704b4d20..302231793674410e2db84e02cdc2f95ec55a72ee 100755 (executable)
@@ -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" \
index db48de3786003a798f22d36d5e0a650f5ca3a007..6420915789f1b4b9b887ae1bf8404638507d2e59 100755 (executable)
@@ -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" \
index f7e1e276f5a450fb305dda6dbd2f8dfd04eab54e..62fd96282b4045a8a90c956c1d00de0bbad45621 100755 (executable)
@@ -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
index 9e4047a116802ad2d313d3c5c65e5eb19379a0c0..98674cdff854d53c27c6c7af4dae0519cb208f0f 100755 (executable)
@@ -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
index 05df1ea87dce43f3f4f5bbfe1d35f6c5433078bf..3e31a0284aa2e8db7881834365bea20318050265 100755 (executable)
@@ -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'
index b1ea27bbd287a4787970d9177bd579e02830c608..00cc38fab7d6870c74a305fe3074222c97a51398 100755 (executable)
@@ -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
index 4295f080130d59d6b036a8ad2e5b32fd552cf0e2..316602777eb0bbb2d383c31dc008bd8f60d9ab3f 100755 (executable)
@@ -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"         \
index 9af3b5582e96380d843f2d4aa38c129f4450ca80..f515e74ecad8fa821a7b194ea26cde0e58043713 100755 (executable)
@@ -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.
index 8bcc7575e1f6c1622ec73ed5b9bb51a331eda530..5705787c05afdbde3079019a36c7bd4f6bed1bbb 100755 (executable)
@@ -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.
index 8a82d146880ddc7e3b98b416398509e9e4128a13..79f95f9aa533a49434b886bff31d5937016998ce 100755 (executable)
@@ -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
index 7a4fc77627e84827b1ca93e9f4ca5e00e1457654..c4cde443d676c9ad01c6601ffadac6bcc739fd88 100755 (executable)
@@ -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
index 5d21752fe8644a9e62f1eaddb5ba0a351edd68ee..a946b96bd77c61223a11dca3b4d796471af89537 100755 (executable)
@@ -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
index df8f13597702a2959d5d37f63ae2736abc07ea4c..51f509e5aa886109f3c849e7780f78b4ce2d008c 100755 (executable)
@@ -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
index 5cb77cbfab12195af23bfa82872ad3a2e104f315..d66a30ffafdcdaed99bcf87fd48e8f9dada2f732 100755 (executable)
@@ -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
index 932c18f17ef4b9375f85b98f9ad7af57569c3c27..7c055b6fdb07200214f7775b73660345d3ecc2ea 100755 (executable)
@@ -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
index f287b5150a399e86624f542ba1c09d7ca65c8019..19c8fe3b6a1adaedfdb31a298ba4aa38bf6c2b7c 100755 (executable)
@@ -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
index c874997e420b0814503340713d62e5e07ab29b24..304ff574440c88c3fa102cc1a23106ae645a17b8 100755 (executable)
@@ -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
index 80fdcbac7a4327aee203a28dbb7b5ceca20967a3..aa41dbac5292fac61ca0eba12efbd8ec5f23f9ca 100755 (executable)
@@ -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
index a7aca860b9a8acf359e975ab26566afbf489f803..01d01226d1dc6880296e0765db2cc33e3b3f8d7a 100755 (executable)
@@ -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
index 97ff4f984258a1d6c31ea6f607cb8d74f4cd9843..5fff628950890e8529a3fe321423c9d9d65394e9 100755 (executable)
@@ -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
index 1905a6e6a7eacd479671c8b182f4a6b0ef0c5459..52404b4df5567ffe52466e637a186298264d0c0e 100755 (executable)
@@ -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
index 17a5f290bed659a0d453e5ae7bb732b0068a3852..390a07dddbbfb6f8db65639edfc1cd2f3e5faa81 100755 (executable)
@@ -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
index 32afa398f11ccc72310bf9bc87e64c315a6e0864..0f0830d2a2963785c64ee53ec77ae841f460f87b 100755 (executable)
@@ -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
 
index 650c921b8fdc808dece92f65681bbafd61fb6f5b..f966100124dddd6a21daba9eff1d9e8f699db91e 100755 (executable)
@@ -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
 }
 
index 6c599446b5e527d2c706ad30ae6c62aa7be3172b..1ed3b21a657f95fc52e390289e7dcef0c321d0f4 100755 (executable)
@@ -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"
index 5c980cf01d60ed381b0ce35224f66fb05ec7daf9..ecc1705bbe606a8136db4ee3db721600d6efe6bb 100755 (executable)
@@ -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"
 
index a71f96ad0dc1aa86ce8bbeed65548072e2ef8dcf..01871d63a43e623124deb5240c9d317d02cf3e9d 100755 (executable)
@@ -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
index e76055fa4436bb548e1d8e215b227e4711cae204..05e69897e2b687ed0998a8fa722bae2ffc349aa0 100755 (executable)
@@ -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
index f58c9ed510e86213f83b0f0487227d581d40cfc4..b0bf403add15ac7bfc0faff7d260598904bfce4a 100755 (executable)
@@ -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
index 4444016bc2a6c39ff29971e1744a65f79e60f1ae..1cf54fc04e705931563ebf320daca1ea739b0856 100755 (executable)
@@ -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
index f488bd06c7a8658fd986a495cb55f0b1dbdee53e..553b186e5e466b392944da249c141dcafeceba79 100755 (executable)
@@ -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
index 5025c0d74164b276d99a9d106eefd48aebdc6cb1..f38e4503857b0f6eab732de83f755ac7bf939875 100755 (executable)
@@ -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
index abf18f1bfee41faa01d4cec833f53d221d93d36a..0c3f81f5bf70269b517ae75f57312dfd4b04a2cc 100755 (executable)
@@ -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
index 8965d9d639fa0fe599d275481ca2ef6f5ea06397..f6ed90b70c6260070429831d3cb2c06299c9c5ac 100755 (executable)
@@ -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
index f2523fca27f265d58ab5838041a6e01d6bfca19d..3c7ae615affcb552ecec11cb4e679f1cb5bf52ee 100755 (executable)
@@ -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
index af77ccaff32bad7144d6af35f58db1378f0054c7..b820dda3a43cf75b2276a8a85681bb0408bc68b2 100755 (executable)
@@ -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
index 90555077f0071287b6922de0e4abc0545ab2b07f..e09efff9e2f1ef2febd4d3b1e69f4821498c50c8 100755 (executable)
@@ -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
index f1cd90c0ec750ea40450e26a2fda5e8022a0b2a8..5c68ebde4c2bb1bbc983aa47af7cffa91b60e53d 100755 (executable)
@@ -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
index 98e2f2384a641a3e4261061322063d360725b47c..9f552ee8a7c72dedf948d12ec7d84317aeba6427 100755 (executable)
@@ -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"
index ab4ea657ee00d88d071736eed1e52bac90f10ab8..3fb705c0226faac44f4be788fcae818607b212e9 100755 (executable)
@@ -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
index 14d02b4fdc8e36fe4908e502842bde2202a18f8c..880dfecb64b49c40a6a8e6fffbccde8da549c9ff 100755 (executable)
@@ -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
index 9f3d7fdebddc8a59736ee678c2bde1e95bd8758c..2f38141686cde2422ad7ed1e59a3fde16584a366 100755 (executable)
@@ -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
index 742180e2b7eae1a6cce93223b63bafe2dc47862f..00a4c25250359a3a9321f5d1abf73d84ea12b604 100755 (executable)
@@ -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
index 0ee9f001c9590a578c58418a26bf48d81f2c6be9..90491bde2c26a4bbf046bf03b56006d5dfb8f33e 100755 (executable)
@@ -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
index c3b33746e669dbf765b3e7df3f32f089bb7d9c70..2aa859060ed7245a6c2be8ae1725639a06bf133b 100755 (executable)
@@ -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
index 86099454ff39bf48de199a8a61e4a6b5fe670159..176c56c0e5b072a8dd7c20d0d225cdfe046c7d3c 100755 (executable)
@@ -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
index ef5bd1983cef3d8a3cccc6e783030fc45f5eca19..8e01411bc0c3cd1f7eb2f84d33bb9f5769c86fdf 100755 (executable)
@@ -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
index 694f424545119daec1466baac1f84a328bd919eb..78271e7b0970e781cc0ffcfcbd145afdf639de81 100755 (executable)
@@ -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
index 2bace19d6f06507d1df5fe7600dcb2c0c51063e3..30afe6da711a090f4fef2821b2bbfc536e8ecd5e 100755 (executable)
@@ -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"
index c15dc4345b7a34a6cb57339bbdcb796f74ac9933..9bde8cbdd9b133d2e4c48d03dad2b011896b7484 100755 (executable)
@@ -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
index b694f5fad6b8998d324dd83ec2a92de4ae25331f..9a6fc96d1c88c79417eb92b3caf85231b1fc1079 100644 (file)
@@ -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
index 62624b15bc65a38dd173b824db13ffb41c4978d7..09a1860302d2b15d730619a71c7f92448cbd8623 100755 (executable)
@@ -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.
index 55937fc0c988b746513310a48c586b44e69dbe6e..b23f86e501f70049bae0432073fca50382823e05 100755 (executable)
@@ -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
index ea3e4ffa13da706bb828885a2cb3ceb5e40654e4..1028c6d8c7e1e6b859aec5d116f53d25054f37c0 100755 (executable)
@@ -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
index 842472aedc180141ca70bb44bb3e043a455c75b7..770a2e00b97cd7c6e55a6df54780c266e3498189 100755 (executable)
@@ -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
index 13c729d29bc4d2efad2baa0500520474b2ef4c9c..710fca701cbdc08872b47f81bcab1f967a3f24e3 100755 (executable)
@@ -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
index 8e01dff05957ccbc2b1dbe4c321fbe43dcdc45da..5d972ccef178e9f950c544c43ddf66e31bc599b1 100755 (executable)
@@ -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
index a6cfdd87f31b5f38c4d10b3e39b4c494fa428766..d918de4fcda97fd78a6cc145a05988d31d4f7d81 100755 (executable)
@@ -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
index ddc28ac9719fcd3b1a9b3e19ece8b04983aae99b..95c89bbab47e0920bbf09560ca6ea6fefac67428 100755 (executable)
@@ -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
 
index 6d1988c8b9b807b5f4f152093642cb9be7dad651..4cd0b267dc070f042618e4c185bfead9f7a5cea8 100755 (executable)
@@ -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
 
index 09200c00501a5d4e38c6215f05fc24f99753a4b2..565dc450a3b74bbdd4492febc81942b017aa3fc6 100755 (executable)
@@ -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
index b31fe6b0a316db43f3e6c98b9e7c5db058b62446..576cee4035ab6bcb1ed9f177410bfc5cdbb89957 100755 (executable)
@@ -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