fstests: _fail test by default when _scratch_mount fails
authorEryu Guan <eguan@redhat.com>
Wed, 7 Feb 2018 09:31:36 +0000 (17:31 +0800)
committerEryu Guan <eguan@redhat.com>
Thu, 22 Feb 2018 06:02:44 +0000 (14:02 +0800)
Previously _scratch_mount didn't check the mount status and most
tests continue to run even if the mount failed (unless test checks
for the mount status explicitly). This would result in running tests
on the underlying filesystem (usually rootfs) and implicit test
failures, and such failures can be annoying and are usually hard to
debug.

Now _fail test by default if _scratch_mount failed and introduce
_try_scratch_mount for tests that need to check mount results
themselves.

Suggested-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
109 files changed:
common/attr
common/dmapi
common/dump
common/encrypt
common/filestreams
common/fuzzy
common/log
common/overlay
common/punch
common/quota
common/rc
common/xfs
tests/btrfs/004
tests/btrfs/007
tests/btrfs/009
tests/btrfs/012
tests/btrfs/042
tests/btrfs/057
tests/btrfs/091
tests/btrfs/131
tests/btrfs/136
tests/ext4/003
tests/ext4/006
tests/ext4/007
tests/ext4/008
tests/ext4/011
tests/ext4/012
tests/ext4/024
tests/ext4/025
tests/ext4/305
tests/ext4/306
tests/generic/015
tests/generic/019
tests/generic/050
tests/generic/052
tests/generic/053
tests/generic/054
tests/generic/055
tests/generic/062
tests/generic/064
tests/generic/068
tests/generic/069
tests/generic/076
tests/generic/077
tests/generic/079
tests/generic/082
tests/generic/083
tests/generic/105
tests/generic/117
tests/generic/120
tests/generic/169
tests/generic/235
tests/generic/270
tests/generic/294
tests/generic/317
tests/generic/318
tests/generic/388
tests/generic/390
tests/generic/403
tests/generic/466
tests/shared/003
tests/xfs/005
tests/xfs/009
tests/xfs/016
tests/xfs/017
tests/xfs/019
tests/xfs/021
tests/xfs/034
tests/xfs/041
tests/xfs/042
tests/xfs/044
tests/xfs/045
tests/xfs/057
tests/xfs/067
tests/xfs/072
tests/xfs/073
tests/xfs/075
tests/xfs/077
tests/xfs/079
tests/xfs/083
tests/xfs/085
tests/xfs/090
tests/xfs/092
tests/xfs/094
tests/xfs/098
tests/xfs/103
tests/xfs/104
tests/xfs/111
tests/xfs/121
tests/xfs/130
tests/xfs/137
tests/xfs/141
tests/xfs/177
tests/xfs/181
tests/xfs/183
tests/xfs/189
tests/xfs/263
tests/xfs/270
tests/xfs/297
tests/xfs/333
tests/xfs/338
tests/xfs/340
tests/xfs/433
tests/xfs/434
tests/xfs/435
tests/xfs/436
tests/xfs/439
tests/xfs/442
tests/xfs/443

index 66b0227f721e6e90c12907f8ff0be09e570ab235..3d1385a493b038d6eca14f246b31b4779e1a665f 100644 (file)
@@ -229,7 +229,7 @@ _require_noattr2()
 {
        _scratch_mkfs_xfs > /dev/null 2>&1 \
                || _fail "_scratch_mkfs_xfs failed on $SCRATCH_DEV"
-       _scratch_mount -o noattr2 > /dev/null 2>&1 \
+       _try_scratch_mount -o noattr2 > /dev/null 2>&1 \
                || _notrun "noattr2 mount option not supported on $SCRATCH_DEV"
        _scratch_unmount
 }
index c8a463a2cac0d73e6f9e43ead650c4a0b9c9108d..5eff3d92f195fca1a4f435ba9308674f626770a0 100644 (file)
@@ -31,10 +31,10 @@ _dmapi_scratch_mount () {
     if [ `echo "$MOUNT_OPTIONS" | grep -c dmapi` -gt 0 -o \
         `echo "$MOUNT_OPTIONS" | grep -c dmi` -gt 0 ] ; then
         #already got dmapi options set
-        _scratch_mount
+        _try_scratch_mount
         dmapi_mount_result=$?
     else
-        _scratch_mount "-o dmapi,mtpt=$SCRATCH_MNT"
+        _try_scratch_mount "-o dmapi,mtpt=$SCRATCH_MNT"
         dmapi_mount_result=$?
     fi
 
index 2b3cfa0f060740aa22dab27f156e880ab1af95a4..7b9c10a254148bd56fb7a3a4cdd2f5f1b48b3455 100644 (file)
@@ -235,7 +235,7 @@ _wipe_fs()
     _require_scratch
 
     _scratch_mkfs_xfs >>$seqres.full || _fail "mkfs failed"
-    _scratch_mount >>$seqres.full || _fail "mount failed"
+    _scratch_mount >>$seqres.full
 }
 
 #
@@ -287,7 +287,7 @@ _stable_fs()
 {
     _saveddir=`pwd`; cd /
     _scratch_unmount >>$seqres.full || _fail "unmount failed"
-    _scratch_mount >>$seqres.full || _fail "mount failed"
+    _scratch_mount >>$seqres.full
     cd $_saveddir
 }
 
index 189c59ee9bbdb05d122d7c7ef9ba09c05fb7a059..3d77ebd2cecca516fc7fe08679d6f37179ecafe3 100644 (file)
@@ -43,7 +43,7 @@ _require_scratch_encryption()
        # Try to mount the filesystem.  If this fails then either the kernel
        # isn't aware of encryption, or the mkfs options were not compatible
        # with encryption (e.g. ext4 with block size != PAGE_SIZE).
-       if ! _scratch_mount &>>$seqres.full; then
+       if ! _try_scratch_mount &>>$seqres.full; then
                _notrun "kernel is unaware of $FSTYP encryption feature," \
                        "or mkfs options are not compatible with encryption"
        fi
index f5441f5a82e908b94096d277cc27e3d508df90bf..d7a656f8bc23a59a668dc84bb6f7aaf2e8d2a1aa 100644 (file)
@@ -111,11 +111,11 @@ _test_streams() {
 
        if [ "$use_iflag" = "0" ]; then
                # mount using filestreams mount option
-               _scratch_mount "-o filestreams" \
+               _try_scratch_mount "-o filestreams" \
                        || _fail "filestreams mount failed"
        else
                # test will set inode flag
-               _scratch_mount || _fail "mount failed"
+               _scratch_mount
        fi
 
        cd $SCRATCH_MNT
index b964fd8cb0fc0d0cab8629bb11c15a18e3e0a5b9..f89765c1bfd2ac5f4232b87f1f959970eb617d27 100644 (file)
@@ -200,7 +200,7 @@ __scratch_xfs_fuzz_field_test() {
 
        # Try to catch the error with scrub
        echo "+ Try to catch the error"
-       _scratch_mount 2>&1
+       _try_scratch_mount 2>&1
        res=$?
        if [ $res -eq 0 ]; then
                # Try an online scrub unless we're fuzzing ag 0's sb,
@@ -245,7 +245,7 @@ __scratch_xfs_fuzz_field_test() {
 
        # See if scrub finds a clean fs
        echo "+ Make sure error is gone (online)"
-       _scratch_mount 2>&1
+       _try_scratch_mount 2>&1
        res=$?
        if [ $res -eq 0 ]; then
                # Try an online scrub unless we're fuzzing ag 0's sb,
index bdb4ed684a08feca01824544b8cec5d052d83b96..b48f6abade772aa0757c6906177f964172aeda09 100644 (file)
@@ -370,7 +370,7 @@ _create_log()
 {
     # mount the FS
     _full "mount"
-    _scratch_mount >>$seqres.full 2>&1
+    _try_scratch_mount >>$seqres.full 2>&1
     if [ $? -ne 0 ] ; then 
        _echofull "mount failed: $MOUNT_OPTIONS"
        return 1
@@ -399,7 +399,7 @@ _create_log_sync()
 {
     # mount the FS
     _full " mount"
-    _scratch_mount >>$seqres.full 2>&1
+    _try_scratch_mount >>$seqres.full 2>&1
     if [ $? -ne 0 ] ; then 
        _echofull "mount failed: $MOUNT_OPTIONS"
        return 1
@@ -519,7 +519,7 @@ _require_v2log()
 
     # test out mount to see if it mounts a v2 log fs
     export MOUNT_OPTIONS="-o logbsize=32k"
-    if ! _scratch_mount >>$seqres.full 2>&1; then
+    if ! _try_scratch_mount >>$seqres.full 2>&1; then
         _notrun "mount/kernel does not support v2 logs"
     fi
 
index a8b0e9369c86e1dc937527ef02dfdcb28dac76c3..e1b07f495e875d8460ca335a6ec836664d40266c 100644 (file)
@@ -167,7 +167,7 @@ _require_scratch_overlay_features()
        done
 
        _scratch_mkfs > /dev/null 2>&1
-       _scratch_mount -o $opts || \
+       _try_scratch_mount -o $opts || \
                _notrun "overlay options '$opts' cannot be enabled on ${SCRATCH_DEV}"
 
        for feature in ${features[*]}; do
index c4ed26192a2219e232202ecda9486e55a432f90d..42a7e97496b731557075d99032c892aa8289de03 100644 (file)
@@ -131,7 +131,7 @@ _test_punch() {
                _dmapi_scratch_mount
        else
                # only unresvsp punch type is used, just do a normal mount
-               _scratch_mount || _fail "mount failed"
+               _scratch_mount
        fi
 
        cd $SCRATCH_MNT
index 2611c484ee35a8f3437ca8507b8e17c4d19fe486..f8e037995ad401cb5fda5adaa9897591bfd0bfd3 100644 (file)
@@ -119,7 +119,7 @@ _scratch_enable_pquota()
        [ "$FSTYP" != "ext4" ] && return
 
        tune2fs -O quota,project $SCRATCH_DEV >>$seqres.full 2>&1
-       _scratch_mount >/dev/null 2>&1 \
+       _try_scratch_mount >/dev/null 2>&1 \
                || _notrun "kernel doesn't support project feature on $FSTYP"
        _scratch_unmount
 }
@@ -202,7 +202,7 @@ _choose_prid()
 _qmount()
 {
     _scratch_unmount >/dev/null 2>&1
-    _scratch_mount || _fail "qmount failed"
+    _try_scratch_mount || _fail "qmount failed"
     # xfs doesn't need these setups and quotacheck even fails on xfs
     # redirect the output to $seqres.full for debug purpose and ignore results
     if [ "$FSTYP" != "xfs" ]; then
index a6caca96c888dfb17b8422de2b59dd2d95c29cd2..51dc9f76284f1b557816fc3fa8c7ded6cbdb6fb2 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -352,13 +352,20 @@ _supports_filetype()
        esac
 }
 
+# mount scratch device with given options but don't check mount status
+_try_scratch_mount()
+{
+       if [ "$FSTYP" == "overlay" ]; then
+               _overlay_scratch_mount $*
+               return $?
+       fi
+       _mount -t $FSTYP `_scratch_mount_options $*`
+}
+
+# mount scratch device with given options and _fail if mount fails
 _scratch_mount()
 {
-    if [ "$FSTYP" == "overlay" ]; then
-        _overlay_scratch_mount $*
-        return $?
-    fi
-    _mount -t $FSTYP `_scratch_mount_options $*`
+       _try_scratch_mount $* || _fail "mount failed"
 }
 
 _scratch_unmount()
@@ -397,7 +404,7 @@ _scratch_cycle_mount()
        opts="-o $opts"
     fi
     _scratch_unmount
-    _scratch_mount "$opts"
+    _try_scratch_mount "$opts" || _fail "cycle mount failed"
 }
 
 _scratch_shutdown()
@@ -524,7 +531,7 @@ _setup_large_ext4_fs()
 
        # mount the filesystem and create 16TB - 4KB files until we consume
        # all the necessary space.
-       _scratch_mount 2>&1 >$tmp_dir/mnt.err
+       _try_scratch_mount 2>&1 >$tmp_dir/mnt.err
        local status=$?
        if [ $status -ne 0 ]; then
                echo "mount failed"
@@ -1103,7 +1110,7 @@ _repair_scratch_fs()
        res=$?
        if [ "$res" -ne 0 ]; then
                echo "xfs_repair returns $res; replay log?"
-               _scratch_mount
+               _try_scratch_mount
                res=$?
                if [ "$res" -gt 0 ]; then
                        echo "mount returns $res; zap log?"
@@ -1872,7 +1879,7 @@ _require_scratch_ext4_crc()
 {
        _scratch_mkfs_ext4 >/dev/null 2>&1
        dumpe2fs -h $SCRATCH_DEV 2> /dev/null | grep -q metadata_csum || _notrun "metadata_csum not supported by this filesystem"
-       _scratch_mount >/dev/null 2>&1 \
+       _try_scratch_mount >/dev/null 2>&1 \
           || _notrun "Kernel doesn't support metadata_csum feature"
        _scratch_unmount
 }
@@ -1888,7 +1895,7 @@ _require_scratch_ext4_feature()
     $MKFS_EXT4_PROG -F $MKFS_OPTIONS -O "$1" \
                    $SCRATCH_DEV 512m >/dev/null 2>&1 \
        || _notrun "mkfs.ext4 doesn't support $1 feature"
-    _scratch_mount >/dev/null 2>&1 \
+    _try_scratch_mount >/dev/null 2>&1 \
        || _notrun "Kernel doesn't support the ext4 feature(s): $1"
     _scratch_unmount
 }
@@ -2322,7 +2329,7 @@ _require_scratch_richacl_xfs()
        _scratch_mkfs_xfs_supported -m richacl=1 >/dev/null 2>&1 \
                || _notrun "mkfs.xfs doesn't have richacl feature"
        _scratch_mkfs_xfs -m richacl=1 >/dev/null 2>&1
-       _scratch_mount >/dev/null 2>&1 \
+       _try_scratch_mount >/dev/null 2>&1 \
                || _notrun "kernel doesn't support richacl feature on $FSTYP"
        _scratch_unmount
 }
@@ -2331,7 +2338,7 @@ _require_scratch_richacl_ext4()
 {
        _scratch_mkfs -O richacl >/dev/null 2>&1 \
                || _notrun "can't mkfs $FSTYP with option -O richacl"
-       _scratch_mount >/dev/null 2>&1 \
+       _try_scratch_mount >/dev/null 2>&1 \
                || _notrun "kernel doesn't support richacl feature on $FSTYP"
        _scratch_unmount
 }
@@ -2993,7 +3000,7 @@ _require_scratch_shutdown()
        [ -x src/godown ] || _notrun "src/godown executable not found"
 
        _scratch_mkfs > /dev/null 2>&1 || _notrun "_scratch_mkfs failed on $SCRATCH_DEV"
-       _scratch_mount || _notrun "_scratch_mount failed on $SCRATCH_MNT"
+       _scratch_mount
 
        if [ $FSTYP = "overlay" ]; then
                if [ -z $OVL_BASE_SCRATCH_DEV ]; then
@@ -3019,7 +3026,8 @@ _require_scratch_dax()
 {
        _require_scratch
        _scratch_mkfs > /dev/null 2>&1
-       _scratch_mount -o dax
+       _try_scratch_mount -o dax || \
+               _notrun "mount $SCRATCH_DEV with dax failed"
        # Check options to be sure. XFS ignores dax option
        # and goes on if dev underneath does not support dax.
        _fs_options $SCRATCH_DEV | grep -qw "dax" || \
@@ -3030,7 +3038,7 @@ _require_scratch_dax()
 # Does norecovery support by this fs?
 _require_norecovery()
 {
-       _scratch_mount -o ro,norecovery || \
+       _try_scratch_mount -o ro,norecovery || \
                _notrun "$FSTYP does not support norecovery"
        _scratch_unmount
 }
@@ -3229,7 +3237,7 @@ _require_atime()
 _require_relatime()
 {
         _scratch_mkfs > /dev/null 2>&1
-        _scratch_mount -o relatime || \
+        _try_scratch_mount -o relatime || \
                 _notrun "relatime not supported by the current kernel"
        _scratch_unmount
 }
index 9b20b03807822c144fc57dfb6b93d7241a156389..9ed78dee08ffeeaac4d1979192876100d5575d07 100644 (file)
@@ -18,7 +18,7 @@ _setup_large_xfs_fs()
        file_size=$(($file_size - $SCRATCH_DEV_EMPTY_SPACE))
 
        # mount the filesystem, create the file, unmount it
-       _scratch_mount 2>&1 >$tmp_dir/mnt.err
+       _try_scratch_mount 2>&1 >$tmp_dir/mnt.err
        local status=$?
        if [ $status -ne 0 ]; then
                echo "mount failed"
@@ -223,7 +223,7 @@ _require_xfs_mkfs_crc()
 _require_xfs_crc()
 {
        _scratch_mkfs_xfs -m crc=1 >/dev/null 2>&1
-       _scratch_mount >/dev/null 2>&1 \
+       _try_scratch_mount >/dev/null 2>&1 \
           || _notrun "Kernel doesn't support crc feature"
        _scratch_unmount
 }
@@ -233,7 +233,7 @@ _require_xfs_crc()
 _require_scratch_xfs_crc()
 {
        _scratch_mkfs_xfs >/dev/null 2>&1
-       _scratch_mount >/dev/null 2>&1 \
+       _try_scratch_mount >/dev/null 2>&1 \
           || _notrun "Kernel doesn't support crc feature"
        xfs_info $SCRATCH_MNT | grep -q 'crc=1' || _notrun "crc feature not supported by this filesystem"
        _scratch_unmount
@@ -252,7 +252,7 @@ _require_xfs_mkfs_finobt()
 _require_xfs_finobt()
 {
        _scratch_mkfs_xfs -m crc=1,finobt=1 >/dev/null 2>&1
-       _scratch_mount >/dev/null 2>&1 \
+       _try_scratch_mount >/dev/null 2>&1 \
           || _notrun "Kernel doesn't support finobt feature"
        _scratch_unmount
 }
@@ -280,7 +280,7 @@ _require_xfs_sparse_inodes()
        _scratch_mkfs_xfs_supported -m crc=1 -i sparse > /dev/null 2>&1 \
                || _notrun "mkfs.xfs does not support sparse inodes"
        _scratch_mkfs_xfs -m crc=1 -i sparse > /dev/null 2>&1
-       _scratch_mount >/dev/null 2>&1 \
+       _try_scratch_mount >/dev/null 2>&1 \
                || _notrun "kernel does not support sparse inodes"
        _scratch_unmount
 }
@@ -599,7 +599,7 @@ _require_meta_uuid()
 
        _scratch_xfs_db -x -c "uuid generate" >/dev/null 2>&1
 
-       _scratch_mount >/dev/null 2>&1 \
+       _try_scratch_mount >/dev/null 2>&1 \
           || _notrun "Kernel doesn't support meta_uuid feature"
        _scratch_unmount
 }
index 1b5b124d9a8993b534e3bf7c60cc0bc35b619239..de583cc355d4e57148845c792af5db34ed539d89 100755 (executable)
@@ -185,7 +185,7 @@ workout()
        echo ""                                     >>$seqres.full
        _scratch_mkfs_sized $fsz >>$seqres.full 2>&1 \
                || _fail "size=$fsz mkfs failed"
-       run_check _scratch_mount
+       _scratch_mount
        # -w ensures that the only ops are ones which cause write I/O
        run_check $FSSTRESS_PROG -d $SCRATCH_MNT -w -p $procs -n 2000 \
                $FSSTRESS_AVOID
@@ -194,7 +194,7 @@ workout()
                $SCRATCH_MNT/$snap_name
 
        run_check _scratch_unmount >/dev/null 2>&1
-       run_check _scratch_mount "-o compress=lzo"
+       _scratch_mount "-o compress=lzo"
 
        # make some noise but ensure we're not touching existing data
        # extents.
@@ -208,7 +208,7 @@ workout()
        run_check $FSSTRESS_PROG -d $clean_dir -w -p $procs -n 2000 \
                $FSSTRESS_AVOID
        run_check _scratch_unmount >/dev/null 2>&1
-       run_check _scratch_mount "-o atime"
+       _scratch_mount "-o atime"
 
        if [ $do_bg_noise -ne 0 ]; then
                # make background noise while backrefs are being walked
index 57f9a79f5f6fbf67846e135620ff522548285282..a8414b21feac13074d6242cfcacff540283d6ff7 100755 (executable)
@@ -65,7 +65,7 @@ workout()
        echo ""                                     >>$seqres.full
        _scratch_mkfs_sized $fsz >>$seqres.full 2>&1 \
                || _fail "size=$fsz mkfs failed"
-       run_check _scratch_mount "-o noatime"
+       _scratch_mount "-o noatime"
 
        run_check $FSSTRESS_PROG -d $SCRATCH_MNT -n $ops $FSSTRESS_AVOID -x \
                "$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/base"
@@ -91,7 +91,7 @@ workout()
        echo ""                                     >>$seqres.full
        _scratch_mkfs_sized $fsz >>$seqres.full 2>&1 \
                || _fail "size=$fsz mkfs failed"
-       run_check _scratch_mount "-o noatime"
+       _scratch_mount "-o noatime"
 
        _run_btrfs_util_prog receive $SCRATCH_MNT < $tmp/base.snap
        run_check $FSSUM_PROG -r $tmp/base.fssum $SCRATCH_MNT/base
index 2ffb81730d2445c42b80ebdefee1e2dd38a7c45a..d720400519cfd476235eac5bfc5695b4a26162d7 100755 (executable)
@@ -59,7 +59,7 @@ $BTRFS_UTIL_PROG subvolume set-default $subvolid $SCRATCH_MNT >> $seqres.full 2>
        || _fail "couldn't set default"
 $BTRFS_UTIL_PROG subvolume delete $SCRATCH_MNT/newvol >> $seqres.full 2>&1
 _scratch_unmount
-_scratch_mount || _fail "mount should have succeeded"
+_try_scratch_mount || _fail "mount should have succeeded"
 
 echo "Silence is golden"
 status=0 ; exit
index 85c82f07df4e7d6d849cd914fd0413994fc5a0e7..ac0f405a0d9ab505fc16c033ae93c7238c8ec99e 100755 (executable)
@@ -74,7 +74,7 @@ _scratch_unmount
 # Convert it to btrfs, mount it, verify the data
 $BTRFS_CONVERT_PROG $SCRATCH_DEV >> $seqres.full 2>&1 || \
        _fail "btrfs-convert failed"
-_scratch_mount || _fail "Could not mount new btrfs fs"
+_try_scratch_mount || _fail "Could not mount new btrfs fs"
 # (Ignore the symlinks which may be broken/nonexistent)
 diff -r /lib/modules/`uname -r`/ $SCRATCH_MNT/`uname -r`/ 2>&1 | grep -vw "source\|build"
 
@@ -114,7 +114,7 @@ _scratch_unmount
 # Convert it to btrfs, mount it and delete "ext2_saved"
 $BTRFS_CONVERT_PROG $SCRATCH_DEV >> $seqres.full 2>&1 || \
        _fail "btrfs-convert failed"
-_scratch_mount || _fail "Could not mount new btrfs fs"
+_try_scratch_mount || _fail "Could not mount new btrfs fs"
 $BTRFS_UTIL_PROG subvolume delete $SCRATCH_MNT/ext2_saved >> $seqres.full 2>&1 ||
        _fail "failed to delete ext2_saved subvolume"
 _scratch_unmount
index cf3eac239b0fea0fa12777e4bf13914f41e22992..be349e3d49c417622a851b3402d202859f0bbc30 100755 (executable)
@@ -48,7 +48,7 @@ _require_btrfs_qgroup_report
 rm -f $seqres.full
 
 run_check _scratch_mkfs
-run_check _scratch_mount
+_scratch_mount
 
 LIMIT_SIZE=$((10 * 1024 * 1024))
 
index 8d355795359efb7bbcff6014952285bcb7b4dec0..a834b7639d8fe3c74c603c0c77e336b8b7ec58d1 100755 (executable)
@@ -54,7 +54,7 @@ run_check _scratch_mkfs "-b 1g --nodesize 4096"
 # inode cache is saved in the FS tree itself for every
 # individual FS tree,that affects the sizes reported by qgroup show
 # so we need to explicitly turn it off to get consistent values.
-run_check _scratch_mount "-o noinode_cache"
+_scratch_mount "-o noinode_cache"
 
 # -w ensures that the only ops are ones which cause write I/O
 run_check $FSSTRESS_PROG -d $SCRATCH_MNT -w -p 5 -n 1000 \
index e3c43c761b4c928f9fb2f101394e43fabda36415..ca1d64c3dc09af3a028830765b9cdf286612cde1 100755 (executable)
@@ -61,12 +61,12 @@ run_check _scratch_mkfs "--nodesize $NODESIZE"
 # result.
 # discard error output since we will check return value manually.
 # also disable all compression, or output will mismatch with golden output
-_scratch_mount "-o noinode_cache,compress=no,compress-force=no" 2> /dev/null
+_try_scratch_mount "-o noinode_cache,compress=no,compress-force=no" 2> /dev/null
 
 # Check for old kernel which doesn't support 'noinode_cache' mount option
 if [ $? -ne 0 ]; then
        support_noinode_cache="no"
-       run_check _scratch_mount
+       _scratch_mount
 fi
 
 _run_btrfs_util_prog subvolume create $SCRATCH_MNT/subv1
index ce486e6870e100cc7e9a56a7eda82216afd98d82..f7a0286e88d04b15ee38b557c7f8216a85a17efa 100755 (executable)
@@ -114,8 +114,8 @@ _scratch_unmount
 
 mkfs_v2
 echo "Trying to mount without free space tree"
-_scratch_mount -o nospace_cache >/dev/null 2>&1 || echo "mount failed"
-_scratch_mount -o space_cache=v1 >/dev/null 2>&1 || echo "mount failed"
+_try_scratch_mount -o nospace_cache >/dev/null 2>&1 || echo "mount failed"
+_try_scratch_mount -o space_cache=v1 >/dev/null 2>&1 || echo "mount failed"
 
 mkfs_v2
 echo "Mounting existing free space tree"
index d5408661bb7a45de70e68171b0182f5d556c3df7..6d46bd6c7daa6b48129473d7bcac39bee4be9974 100755 (executable)
@@ -102,7 +102,7 @@ _scratch_unmount
 # Convert non-extent & extent data to btrfs, mount it, verify the data
 $BTRFS_CONVERT_PROG $SCRATCH_DEV >> $seqres.full 2>&1 || \
        _fail "btrfs-convert failed"
-_scratch_mount || _fail "Could not mount new btrfs fs"
+_try_scratch_mount || _fail "Could not mount new btrfs fs"
 
 # Compute md5 for converted files.
 find "$SCRATCH_MNT/ext3_ext4_data" -type f -fprint "$BTRFS_MD5SUM"
index eafe9a53cb347a454d6272779784718fd3968a81..7f2d6974fb384c4bb0afd4e4b1a01f5816b001d4 100755 (executable)
@@ -44,7 +44,7 @@ rm -f $seqres.full
 
 $MKFS_EXT4_PROG -F -O bigalloc -C 65536  -g 256 $SCRATCH_DEV 512m \
        >> $seqres.full 2>&1
-_scratch_mount || _fail "couldn't mount fs"
+_scratch_mount
 
 $XFS_IO_PROG -f -c "pwrite 0 256m -b 1M" $SCRATCH_MNT/testfile 2>&1 | \
        _filter_xfs_io
index bb9b7e574c297d4817a83c0b3ff6e120e623fb5b..a1e511e30c99b04837ca0280f7b4f44918436e3a 100755 (executable)
@@ -112,7 +112,7 @@ echo "++ corrupt image" >> $seqres.full
 e2fuzz ${FUZZ_ARGS} ${SCRATCH_DEV} >> $seqres.full 2>&1
 
 echo "++ mount image" >> $seqres.full
-_scratch_mount >> $seqres.full 2>&1
+_try_scratch_mount >> $seqres.full 2>&1
 
 echo "++ test scratch" >> $seqres.full
 _scratch_fuzz_test >> $seqres.full 2>&1
@@ -134,7 +134,7 @@ _check_scratch_fs >> $seqres.full 2>&1
 
 ROUND2_LOG="${tmp}-round2-${fsck_pass}.log"
 echo "++ mount image (2)" >> $ROUND2_LOG
-_scratch_mount >> $ROUND2_LOG 2>&1
+_try_scratch_mount >> $ROUND2_LOG 2>&1
 
 echo "++ chattr -R -i" >> $ROUND2_LOG
 $CHATTR_PROG -R -f -i "${SCRATCH_MNT}/" > /dev/null 2>> $ROUND2_LOG
index 6719c8b9450f7de51b7c0604b5fbe4bbdaed855d..aeaa2d322930056cdf5c61d71d3af7621df47629 100755 (executable)
@@ -89,7 +89,7 @@ dumpe2fs -g "${SCRATCH_DEV}" 2>/dev/null | awk -F ':' '{if ($1 == 0) {print $3}}
 done
 
 echo "+ mount image"
-_scratch_mount 2> /dev/null && _fail "mount should not succeed"
+_try_scratch_mount 2> /dev/null && _fail "mount should not succeed"
 
 echo "+ repair fs"
 # Have to specify backup sb and blocksize here so we don't pick up superblocks
index 7264f3723133c1ec8897c2e8fcb05509da942bdf..c84a28bfb0a900bfd3a83396a7b4d9d8c2ae7bd7 100755 (executable)
@@ -85,7 +85,7 @@ dumpe2fs -g "${SCRATCH_DEV}" 2>/dev/null | awk -F ':' '{if (int($4) != -1) {prin
 done
 
 echo "+ mount image"
-_scratch_mount 2> /dev/null && _fail "mount should not succeed"
+_try_scratch_mount 2> /dev/null && _fail "mount should not succeed"
 
 echo "+ repair fs"
 e2fsck -fy "${SCRATCH_DEV}" >> $seqres.full 2>&1
index 03e4cd65bb8722737c6a75b03e8878dcc4f93fa7..c21442fce23c5c07a14a21e82c77a4fcd5ca6ffd 100755 (executable)
@@ -73,13 +73,13 @@ blk="$(dumpe2fs "${SCRATCH_DEV}" 2> /dev/null | grep 'MMP block number' | sed -e
 $XFS_IO_PROG -f -c "pwrite -S 0x62 $((blk * blksz + 16)) 8" "${SCRATCH_DEV}" >> $seqres.full
 
 echo "+ mount image"
-_scratch_mount 2> /dev/null && _fail "mount should fail due to bad MMP"
+_try_scratch_mount 2> /dev/null && _fail "mount should fail due to bad MMP"
 
 echo "+ repair fs"
 e2fsck -fy "${SCRATCH_DEV}" >> $seqres.full 2>&1
 
 echo "+ mount image (2)"
-_scratch_mount || _fail "mount should not fail; MMP has been fixed"
+_try_scratch_mount || _fail "mount should not fail; MMP has been fixed"
 
 echo "+ check fs (2)"
 e2fsck -fn "${SCRATCH_DEV}" >> $seqres.full 2>&1 || _fail "fsck should not fail"
index 85880faf098ddd795ca638ead7175eb7323241e5..1bf4fe5eb78fc79252c695138e6fe79b9c02ae9e 100755 (executable)
@@ -72,13 +72,13 @@ echo "+ corrupt image"
 debugfs -w -R 'zap -f <8> 0' "${SCRATCH_DEV}" 2> /dev/null
 
 echo "+ mount image"
-_scratch_mount 2> /dev/null && _fail "mount should fail due to bad journal"
+_try_scratch_mount 2> /dev/null && _fail "mount should fail due to bad journal"
 
 echo "+ repair fs"
 e2fsck -fy "${SCRATCH_DEV}" >> $seqres.full 2>&1
 
 echo "+ mount image (2)"
-_scratch_mount || _fail "mount should not fail; journal has been fixed"
+_try_scratch_mount || _fail "mount should not fail; journal has been fixed"
 
 echo "+ check fs (2)"
 e2fsck -fn "${SCRATCH_DEV}" >> $seqres.full 2>&1 || _fail "fsck should not fail"
index c0d26ac6e7697a6be058ec7e58c8437eb02a093f..a9ce24d406d443299e93fb908a2d9d261fdddb42 100755 (executable)
@@ -79,7 +79,7 @@ _scratch_unmount
 debugfs -w -R "set_super_value s_last_orphan $inum" $SCRATCH_DEV &>>$seqres.full
 
 # Try to mount the filesystem.  This would hit a BUG() in fs/ext4/inode.c.
-_scratch_mount
+_try_scratch_mount
 
 # success, all done
 echo "Didn't crash!"
index 2a7b35fc3ee2b852637e9d1c550280b68173cea7..588c7a3f53790ab508547d3494349f34131896fb 100755 (executable)
@@ -58,7 +58,7 @@ _scratch_mkfs "-O bigalloc,meta_bg,^resize_inode" >> $seqres.full 2>&1
 $DEBUGFS_PROG -w -R "ssv first_meta_bg 842150400" $SCRATCH_DEV >> $seqres.full 2>&1
 
 echo "Try to mount a modified ext4 fs"
-_scratch_mount >> $seqres.full 2>&1 || echo "Fail to mount ext4 fs expectedly"
+_try_scratch_mount >> $seqres.full 2>&1 || echo "Fail to mount ext4 fs expectedly"
 
 # success, all done
 status=0
index 09db2e11fc49c4a1630fc11bd014ae00423df5b0..b7331ae21fd03f68066b71b38107c6f13a7dfd68 100755 (executable)
@@ -61,7 +61,7 @@ PIDS=$!
 # 30 loops is enough to crash a buggy kernel
 i=0
 while [ $i -lt 30 ]; do
-       _scratch_mount
+       _try_scratch_mount
        _scratch_unmount
        let i=i+1
 done
index 70f281dbaf39738a62365128c096451cc0dbfcc8..7d00bad6c1ce080883ac8064813b3e0afd67e709 100755 (executable)
@@ -53,7 +53,7 @@ if grep -q 64bit /etc/mke2fs.conf ; then
     features="^extents,^64bit"
 fi
 $MKFS_EXT4_PROG -F -O "$features" $SCRATCH_DEV 512m >> $seqres.full 2>&1
-_scratch_mount || _fail "couldn't mount fs"
+_scratch_mount
 
 # Create a small non-extent-based file
 echo "Create 1m testfile1"
index 9dcdde9e44625dd35be9b92b9ef7c14a8f9d6501..bdae86dd6fb204bff79d6a977d8e409a9db90be9 100755 (executable)
@@ -59,7 +59,7 @@ _require_no_large_scratch_dev
 # tolerance of 1%
 _scratch_mkfs_sized `expr 101 \* 1024 \* 1024` >/dev/null 2>&1 \
     || _fail "mkfs failed"
-_scratch_mount || _fail "mount failed"
+_scratch_mount
 out=$SCRATCH_MNT/fillup.$$
 rm -f $seqres.full
 
index 3b24c87ca25a16e15748124ad56ad2f98375f1d3..17ec7dd8229bd4b625639c5b19fcd44693e894a2 100755 (executable)
@@ -166,7 +166,7 @@ _workout()
 
        # In order to check that filesystem is able to recover journal on mount(2)
        # perform mount/umount, after that all errors should be fixed
-       run_check _scratch_mount
+       _scratch_mount
        run_check _scratch_unmount
 }
 
@@ -174,7 +174,7 @@ _workout()
 
 rm -f $seqres.full
 _scratch_mkfs >> $seqres.full 2>&1 || _fail "mkfs failed"
-_scratch_mount || _fail "mount failed"
+_scratch_mount
 allow_fail_make_request
 _workout
 status=$?
index e6e8bc1b973329111062dd805b4f6b3871ff870a..04acfb541fe50abb2a7090c83988347bcb5741a1 100755 (executable)
@@ -61,7 +61,7 @@ blockdev --setro $SCRATCH_DEV
 # Mount it, and make sure we can't write to it, and we can unmount it again
 #
 echo "mounting read-only block device:"
-_scratch_mount 2>&1 | _filter_ro_mount
+_try_scratch_mount 2>&1 | _filter_ro_mount
 
 echo "touching file on read-only filesystem (should fail)"
 touch $SCRATCH_MNT/foo 2>&1 | _filter_scratch
@@ -77,7 +77,7 @@ echo "setting device read-write"
 blockdev --setrw $SCRATCH_DEV
 
 echo "mounting read-write block device:"
-_scratch_mount 2>&1 | _filter_scratch
+_try_scratch_mount 2>&1 | _filter_scratch
 
 echo "touch files"
 touch $SCRATCH_MNT/{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}
@@ -96,7 +96,7 @@ blockdev --setro $SCRATCH_DEV
 # -o norecovery is used.
 #
 echo "mounting filesystem that needs recovery on a read-only device:"
-_scratch_mount 2>&1 | _filter_ro_mount
+_try_scratch_mount 2>&1 | _filter_ro_mount
 
 echo "unmounting read-only filesystem"
 _scratch_unmount 2>&1 | _filter_scratch | _filter_ending_dot
@@ -107,7 +107,7 @@ _scratch_unmount 2>&1 | _filter_scratch | _filter_ending_dot
 # data recovery hack.
 #
 echo "mounting filesystem with -o norecovery on a read-only device:"
-_scratch_mount -o norecovery 2>&1 | _filter_ro_mount
+_try_scratch_mount -o norecovery 2>&1 | _filter_ro_mount
 
 echo "unmounting read-only filesystem"
 _scratch_unmount 2>&1 | _filter_scratch
@@ -120,7 +120,7 @@ blockdev --setrw $SCRATCH_DEV
 # the underlying device is not write protected.
 #
 echo "mounting filesystem that needs recovery with -o ro:"
-_scratch_mount -o ro 2>&1 | _filter_scratch
+_try_scratch_mount -o ro 2>&1 | _filter_scratch
 
 # success, all done
 echo "*** done"
index 126f08e633113358228c140665ff2ad09fde98de..168b55c2df959155b60db242619fed4d9a2aba04 100755 (executable)
@@ -56,8 +56,7 @@ _scratch_mkfs >>$seqres.full 2>&1 \
 _require_metadata_journaling $SCRATCH_DEV
 
 echo "mount"
-_scratch_mount >>$seqres.full 2>&1 \
-    || _fail "mount failed: $MOUNT_OPTIONS"
+_scratch_mount
 
 echo "touch files"
 touch $SCRATCH_MNT/{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}
@@ -79,7 +78,7 @@ if false; then
 fi
 
 echo "mount with replay"
-_scratch_mount $mnt >>$seqres.full 2>&1 \
+_try_scratch_mount $mnt >>$seqres.full 2>&1 \
     || _fail "mount failed: $mnt $MOUNT_OPTIONS"
 
 echo "ls SCRATCH_MNT"
index cf46a93cf727a354d06df29f9fe4d03368051624..e2765d2f4c05c51db322d31f4bfceda8f53f6cd6 100755 (executable)
@@ -48,7 +48,7 @@ test=$SCRATCH_MNT/test
 
 # make filesystem on scratch using the defaults
 _do 'make filesystem on $SCRATCH_DEV' '_scratch_mkfs'
-_do 'mount filesytem' '_scratch_mount'
+_do 'mount filesytem' '_try_scratch_mount'
 
 # create test files and set acls
 acls="
index 12f471a19090d81ca81c932a7670d7d31b18d51d..84b76e67e51d5ddbf7676ea87fb265d6d6ba79b5 100755 (executable)
@@ -83,7 +83,7 @@ for s in sync nosync ; do
 
        # mount the FS
        _echofull "mount"
-       if ! _scratch_mount >>$seqres.full 2>&1; then
+       if ! _try_scratch_mount >>$seqres.full 2>&1; then
            _echofull "mount failed: $MOUNT_OPTIONS"
            continue
        fi
@@ -118,7 +118,7 @@ for s in sync nosync ; do
        _print_logstate
 
        _echofull "mount with replay"
-       _scratch_mount >>$seqres.full 2>&1 \
+       _try_scratch_mount >>$seqres.full 2>&1 \
            || _fail "mount failed: $MOUNT_OPTIONS"
 
        # check on what FS looks like after log recovery
index c543e75179409e659a8f65088afb850f27a0fab3..7f565251bb28004570f8f995523d6aa02d460f07 100755 (executable)
@@ -105,7 +105,7 @@ do
 
     # mount the FS
     _echofull "mount"
-    if ! _scratch_mount $QUOTA_OPTION >>$seqres.full 2>&1; then
+    if ! _try_scratch_mount $QUOTA_OPTION >>$seqres.full 2>&1; then
        _echofull "mount failed: $MOUNT_OPTIONS"
        continue
     fi
@@ -131,7 +131,7 @@ do
     _scratch_xfs_logprint -n >>$seqres.full 2>&1
 
     _echofull "mount with replay"
-    _scratch_mount $QUOTA_OPTION >>$seqres.full 2>&1 \
+    _try_scratch_mount $QUOTA_OPTION >>$seqres.full 2>&1 \
        || _fail "mount failed: $MOUNT_OPTIONS"
 
     # check on what FS looks like after log recovery
index 643f02c3f799fd5910fef65837f1e290676022e6..f0820eac916a5db7444b596bac9a9f71128fe4f6 100755 (executable)
@@ -80,7 +80,7 @@ rm -f $tmp.backup1 $tmp.backup2 $seqres.full
 
 # real QA test starts here
 _scratch_mkfs > /dev/null 2>&1 || _fail "mkfs failed"
-_scratch_mount || _fail "mount failed"
+_scratch_mount
 _create_test_bed
 
 # In kernels before 3.0, getxattr() fails with EPERM for an attribute which
index 156485eef3a9f2e752921f6541d353b2737e01d9..26fb630168b2e0680d74cbb005a84840a5c9874f 100755 (executable)
@@ -50,7 +50,7 @@ _require_xfs_io_command "fcollapse"
 rm -f $seqres.full
 
 _scratch_mkfs >> $seqres.full 2>&1 || _fail "mkfs failed"
-_scratch_mount || _fail "mount failed"
+_scratch_mount
 
 src=$SCRATCH_MNT/testfile
 dest=$SCRATCH_MNT/testfile.dest
index bd12278cdd25c638a34fc6f56728697b80719af5..1a852534a5497104714f0c9dda744768fbb7a896 100755 (executable)
@@ -62,8 +62,7 @@ echo "*** MKFS ***"                         >>$seqres.full
 echo ""                                     >>$seqres.full
 _scratch_mkfs                               >>$seqres.full 2>&1 \
     || _fail "mkfs failed"
-_scratch_mount                              >>$seqres.full 2>&1 \
-    || _fail "mount failed"
+_scratch_mount
 
 touch $tmp.running
 
index 15586e9b9144f30398bc413f04156228162aaf5e..0121929ba78b4227d2386043f1206972aff5cb55 100755 (executable)
@@ -48,7 +48,7 @@ echo "*** mkfs"
 _scratch_mkfs >/dev/null 2>&1 || _fail "mkfs failed"
 
 echo "*** mount FS"
-_scratch_mount >/dev/null || _fail "mount failed"
+_scratch_mount
 
 cd $SCRATCH_MNT
 
index ac7653332cb0212cb70534b73b36a678e1c559b4..033bc005dca3f0d56920fce8236138c8f4a7ae4c 100755 (executable)
@@ -66,8 +66,7 @@ echo "*** MKFS ***"                         >>$seqres.full
 echo ""                                     >>$seqres.full
 _scratch_mkfs                               >>$seqres.full 2>&1 \
        || _fail "mkfs failed"
-_scratch_mount                              >>$seqres.full 2>&1 \
-       || _fail "mount failed"
+_scratch_mount
 
 echo "*** test concurrent block/fs access"
 
index add16ea8f5238499a71def5f58316cc2a7b2edb3..1175f6f4b554889f317a6166e38e4f01a9fba575 100755 (executable)
@@ -68,8 +68,7 @@ echo ""                                     >>$seqres.full
 SIZE=`expr 50 \* 1024 \* 1024`
 _scratch_mkfs_sized $SIZE                   >>$seqres.full 2>&1 \
        || _fail "mkfs failed"
-_scratch_mount                              >>$seqres.full 2>&1 \
-       || _fail "mount failed"
+_scratch_mount
 mkdir $SCRATCH_MNT/subdir
 
 echo "*** set default ACL"
index c2db6bf1f744217191592e1f9c528656992cf6b4..7669249ce8c42827d84ad0b2b2457ea097de8180 100755 (executable)
@@ -53,7 +53,7 @@ _require_scratch
 
 # real QA test starts here
 _scratch_mkfs >/dev/null 2>&1 || _fail "mkfs failed"
-_scratch_mount || _fail "mount failed"
+_scratch_mount
 
 echo "*** starting up"
 $timmutable -c $SCRATCH_MNT/$seq >$tmp.out 2>&1
index a41afe6e6d20a571e6dbb7224baccc3ce8446274..7a11c1ac95384915eed1ad49099caa4a3b610ba1 100755 (executable)
@@ -68,10 +68,10 @@ quotaon $SCRATCH_MNT >>$seqres.full 2>&1
 # quota, but currently xfs doesn't fail in this case, the unknown option is
 # just ignored, but quota is still on. This may change in future, let's
 # re-consider the case then.
-_scratch_mount "-o remount,ro,nosuchopt" >>$seqres.full 2>&1
+_try_scratch_mount "-o remount,ro,nosuchopt" >>$seqres.full 2>&1
 quotaon -p $SCRATCH_MNT | _filter_scratch | filter_project_quota_line
 # second remount should succeed, no oops or hang expected
-_scratch_mount "-o remount,ro" || _fail "second remount,ro failed"
+_try_scratch_mount "-o remount,ro" || _fail "second remount,ro failed"
 
 # success, all done
 status=0
index 9f09a7b09e8bed01bd3e2ebe176a71fcd1e078f7..ac97952c35c065c7d356f081abec320703f7aa89 100755 (executable)
@@ -78,8 +78,7 @@ workout()
                _scratch_mkfs_sized $fsz >>$seqres.full 2>&1 \
                        || _fail "size=$fsz mkfs failed"
        fi
-       _scratch_mount                              >>$seqres.full 2>&1 \
-               || _fail "mount failed"
+       _scratch_mount
 
        # -w ensures that the only ops are ones which cause write I/O
        FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -w -p $procs -n $nops $FSSTRESS_AVOID`
index 8b6aa5268bc0f5d3204f1f02b5ec9bc6bcdbb76b..6ee123e4a070e2da62e1de85483675eeef4852c8 100755 (executable)
@@ -62,7 +62,7 @@ echo "*** MKFS ***"                         >>$seqres.full
 echo ""                                     >>$seqres.full
 _scratch_mkfs                               >>$seqres.full 2>&1 \
        || _fail "mkfs failed"
-_scratch_mount                              >>$seqres.full 2>&1 \
+_try_scratch_mount                      >>$seqres.full 2>&1 \
        || _fail "mount failed"
 
 cd $SCRATCH_MNT
index 58165eaac7cd27a069809eda5df1adb8a9f34d78..67e68c6e91e2be5e3a293457d40f0bdf15ceac16 100755 (executable)
@@ -87,8 +87,7 @@ echo "*** MKFS ***"                         >>$seqres.full
 echo ""                                     >>$seqres.full
 _scratch_mkfs                               >>$seqres.full 2>&1 \
     || _fail "mkfs failed"
-_scratch_mount                              >>$seqres.full 2>&1 \
-    || _fail "mount failed"
+_scratch_mount
 
 mkdir -p $SCRATCH_MNT/fsstress
 
index 7d65f6201e86a1e936b54e1520481668d44f66b5..1180c10a59f1f02cc3769dc3ddf5b7ea403ace88 100755 (executable)
@@ -60,7 +60,7 @@ _compare_access_times()
 
 }
 
-if ! _scratch_mount "-o noatime" >$tmp.out 2>&1
+if ! _try_scratch_mount "-o noatime" >$tmp.out 2>&1
 then
     cat $tmp.out
     echo "!!! mount failed"
index f51f4d1981eadb2a79375402022b0babd89c7f02..f0ed55edbdc5728ed025fe179b7e3c2f041f6234 100755 (executable)
@@ -60,8 +60,7 @@ _require_scratch
 _scratch_mkfs >>$seqres.full 2>&1 \
        || _fail "mkfs scratch failed"
 
-_scratch_mount >>$seqres.full 2>&1 \
-    || _fail "mount failed: $MOUNT_OPTIONS"
+_scratch_mount
 
 echo "# creating new file for io"
 touch $SCRATCH_MNT/testfile
index f991b1b73ea085d24f49ba7ca4c5d083c874853f..9cd24729e5708a2857d2171e4c9e384fe3ebbc75 100755 (executable)
@@ -69,9 +69,9 @@ do_repquota
 # https://bugzilla.redhat.com/show_bug.cgi?id=563267
 #
 # then you need a more recent mount binary.
-_scratch_mount "-o remount,ro" 2>&1 | tee -a $seqres.full | _filter_scratch
+_try_scratch_mount "-o remount,ro" 2>&1 | tee -a $seqres.full | _filter_scratch
 touch $SCRATCH_MNT/failed 2>&1 | tee -a $seqres.full | _filter_scratch
-_scratch_mount "-o remount,rw" 2>&1 | tee -a $seqres.full | _filter_scratch
+_try_scratch_mount "-o remount,rw" 2>&1 | tee -a $seqres.full | _filter_scratch
 
 $XFS_IO_PROG -c 'pwrite 0 8k' -c 'fsync' \
                        $SCRATCH_MNT/testfile >>$seqres.full 2>&1
index 318f532ae9c00a6e7f187718bb1d70da62139f73..f5026ba0cd300b2f8b2e722bea3ac363eccc918e 100755 (executable)
@@ -83,7 +83,7 @@ _require_command "$KILLALL_PROG" killall
 
 rm -f $seqres.full
 _scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1
-_scratch_mount "-o usrquota,grpquota" || _fail "mount failed"
+_scratch_mount "-o usrquota,grpquota"
 chmod 777 $SCRATCH_MNT
 quotacheck -u -g $SCRATCH_MNT 2>/dev/null
 quotaon -u -g $SCRATCH_MNT 2>/dev/null
index fb5d9aa80524b1d6e74b305cc610644f77f4639d..16687ded28785c33c78cbd7bc22eb3bb6f8a5520 100755 (executable)
@@ -67,7 +67,7 @@ rm -rf $THIS_TEST_DIR
 mkdir $THIS_TEST_DIR || _fail "Could not create dir for test"
 
 _create_files 2>&1 | _filter_scratch
-_scratch_mount -o remount,ro || _fail "Could not remount scratch readonly"
+_try_scratch_mount -o remount,ro || _fail "Could not remount scratch readonly"
 _create_files 2>&1 | _filter_scratch
 
 # success, all done
index 7e40b1fd7612ccdf09c39b401ae465894c51463b..6d1e932bde1f4800bd8d1257df60cb4ba10515b6 100755 (executable)
@@ -83,7 +83,7 @@ _scratch_unmount >/dev/null 2>&1
 echo "*** MKFS ***" >>$seqres.full
 echo ""             >>$seqres.full
 _scratch_mkfs       >>$seqres.full 2>&1 || _fail "mkfs failed"
-_scratch_mount      >>$seqres.full 2>&1 || _fail "mount failed"
+_scratch_mount
 chmod 777 $SCRATCH_MNT
 
 # create $file as "root" in userns, which is $qa_user in parent namespace
index e284317bd5cdb83a1b28071703f1640fddd16796..1c9b3f21dae9fe5c112c683cd67c61d4ea2629f2 100755 (executable)
@@ -93,7 +93,7 @@ _scratch_unmount >/dev/null 2>&1
 echo "*** MKFS ***" >>$seqres.full
 echo ""             >>$seqres.full
 _scratch_mkfs       >>$seqres.full 2>&1 || _fail "mkfs failed"
-_scratch_mount      >>$seqres.full 2>&1 || _fail "mount failed"
+_scratch_mount
 
 touch $file
 chown $acl1.$acl1 $file
index e0f4821822991f89db88cbc99d2c5b2d33af31fb..863f0d899b620f9fdc0a9d938428f6f041de13b2 100755 (executable)
@@ -64,7 +64,7 @@ echo "Silence is golden."
 
 _scratch_mkfs >> $seqres.full 2>&1
 _require_metadata_journaling $SCRATCH_DEV
-_scratch_mount || _fail "mount failed"
+_scratch_mount
 
 for i in $(seq 1 $((50 * TIME_FACTOR)) ); do
        ($FSSTRESS_PROG $FSSTRESS_AVOID -d $SCRATCH_MNT -n 999999 -p 4 >> $seqres.full &) \
index 473015a2ad30bb56a8a71e7ef70e4283e4f8ef2a..3bc6de237330763c623da477022bc9b5e3218e5e 100755 (executable)
@@ -58,7 +58,7 @@ _require_test_program "feature"
 
 _scratch_mkfs >>$seqres.full 2>&1
 # We don't want to freeze/unfreeze root fs if mount scratch dev failed
-_scratch_mount >>$seqres.full 2>&1 || _fail "mount failed"
+_scratch_mount
 
 num_cpus=`$here/src/feature -o`
 
index 31c481b4e23eeefcff9dd4f0c74e4678fe5bc893..d6706d3dd6403d7a23319a732cd4b4937b7fc08a 100755 (executable)
@@ -54,7 +54,7 @@ _require_scratch
 _require_attrs
 
 _scratch_mkfs > $seqres.full 2>&1 || _fail "mkfs"
-_scratch_mount || _fail "mount"
+_scratch_mount
 
 # create xattr small enough for local format on XFS
 touch $SCRATCH_MNT/file
index 07f24a746151f9b58cf6e605959515192dc9ace5..341f0722ce3b17135ff1c5c957b2eb7493ee2c16 100755 (executable)
@@ -60,7 +60,7 @@ for blocksize in 512 1024 2048 4096 8192 16384 32768 65536; do
        # Try to format and mount with the given blocksize.  If they don't
        # succeed, move on to the next block size.
        if ! _scratch_mkfs_sized $devsize $blocksize >> $seqres.full 2>&1 ||
-          ! _scratch_mount >> $seqres.full 2>&1 ||
+          ! _try_scratch_mount >> $seqres.full 2>&1 ||
           test "$(stat -f -c '%S' $SCRATCH_MNT)" -ne "$blocksize"; then
                echo "+++ Format and mount failed" >> $seqres.full
                continue
index 8e02e82158488c10d65fd1ea392863b0174747cc..9a9956cf44de68a1e5c7e43733ae68c6e77baf22 100755 (executable)
@@ -63,7 +63,7 @@ debugfs -w -R "feature +needs_recovery" $SCRATCH_DEV \
        >>$seqres.full 2>&1
 
 # mount with noload option
-_scratch_mount "-o noload" >>$seqres.full 2>&1
+_try_scratch_mount "-o noload" >>$seqres.full 2>&1
 
 # success, all done
 status=0
index ebf4b15ec9b51d0d97414de47c0f971980ed84da..0978729bcfa65791fba87b89ec671fc496afb3d0 100755 (executable)
@@ -59,7 +59,7 @@ _scratch_mkfs_xfs -m crc=1 >> $seqres.full 2>&1 || _fail "mkfs failed"
 $XFS_IO_PROG -c "pwrite 224 4" -c fsync $SCRATCH_DEV | _filter_xfs_io
 
 # should FAIL, the crc is bad; golden output contains mount failure
-_scratch_mount 2>&1 | _filter_error_mount
+_try_scratch_mount 2>&1 | _filter_error_mount
 
 # success, all done
 status=0
index 1a5bd4d346fd67499000f7789f9b10694fb77b70..1caeb33e780f4fdd73dfaeff39c0daac88e765e2 100755 (executable)
@@ -58,7 +58,7 @@ _init()
     fi
 
     echo "*** mount"
-    if ! _scratch_mount
+    if ! _try_scratch_mount
     then
         echo "failed to mount $SCRATCH_DEV"
         exit 1
index 0163716047d54e233b0807ed2ddc0399f39157ae..fde76622fad9f7b910f3e917481f9833c5406690 100755 (executable)
@@ -91,7 +91,7 @@ _log_traffic()
     out=$SCRATCH_MNT/$$.tmp
 
     echo "   *** mount"
-    if ! _scratch_mount
+    if ! _try_scratch_mount
     then
         echo "failed to mount $SCRATCH_DEV"
         exit 1
index b576cd1540381a2580e8b6d5113ffaaa2bebe4f6..5aeba16e0b2e307ea8835dd0dd7efef22191f6a9 100755 (executable)
@@ -59,8 +59,7 @@ echo "*** MKFS ***"                         >>$seqres.full
 echo ""                                     >>$seqres.full
 _scratch_mkfs_xfs                           >>$seqres.full 2>&1 \
     || _fail "mkfs failed"
-_scratch_mount                              >>$seqres.full 2>&1 \
-    || _fail "mount failed"
+_scratch_mount
 
 echo "*** test"
 
@@ -70,7 +69,7 @@ do
        FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -n 1000 $FSSTRESS_AVOID`
         $FSSTRESS_PROG  $FSSTRESS_ARGS >>$seqres.full
 
-        _scratch_mount -o remount,ro \
+        _try_scratch_mount -o remount,ro \
             || _fail "remount ro failed"
 
         echo ""                                 >>$seqres.full
@@ -84,7 +83,7 @@ do
         echo ""                             >>$seqres.full
         _scratch_xfs_check                  >>$seqres.full 2>&1 \
             || _fail "xfs_check failed"
-        _scratch_mount -o remount,rw \
+        _try_scratch_mount -o remount,rw \
             || _fail "remount rw failed"
 done
 
index 3e4f1692ff89787c5859b8ef8470870ca20073df..10d4494682c5da45072706e8b9060073c18afdd5 100755 (executable)
@@ -122,7 +122,7 @@ _verify_fs()
 
        echo "*** mount FS"
        _full " mount"
-       _scratch_mount >>$seqfull 2>&1 \
+       _try_scratch_mount >>$seqfull 2>&1 \
                || _fail "mount failed"
 
        echo "*** verify FS"
index 0471b9539af7c72d6613916a055407b9cb2503ed..f8f4e156590551fc9de24c23328f790e8ef0eea5 100755 (executable)
@@ -87,8 +87,7 @@ _scratch_mkfs_xfs >/dev/null \
        || _fail "mkfs failed"
 
 echo "*** mount FS"
-_scratch_mount >/dev/null \
-       || _fail "mount failed"
+_scratch_mount
 
 testfile=$SCRATCH_MNT/testfile
 echo "*** make test file 1"
index 2bf319bf68828d53231901a5c9c367f1478ebc9c..a3db571ad02125fdf34ce06e991f05654da7da90 100755 (executable)
@@ -57,8 +57,7 @@ echo "*** MKFS ***"                         >>$seqres.full
 echo ""                                     >>$seqres.full
 _scratch_mkfs_xfs                           >>$seqres.full 2>&1 \
     || _fail "mkfs failed"
-_scratch_mount                              >>$seqres.full 2>&1 \
-    || _fail "mount failed"
+_scratch_mount
 
 echo "*** test"
 
index 1b9500f723bb42b31808ec703e2bcda425e10de6..d5ecc6df8ca762dbdee0d5f1ec5c3e036ff0e0cc 100755 (executable)
@@ -67,7 +67,7 @@ _scratch_mkfs_xfs -dsize=${agsize}m,agcount=1 2>&1 >/dev/null || _fail "mkfs fai
 bsize=`_scratch_mkfs_xfs -dsize=${agsize}m,agcount=1 2>&1 | _filter_mkfs 2>&1 \
                | perl -ne 'if (/dbsize=(\d+)/) {print $1;}'`
 onemeginblocks=`expr 1048576 / $bsize`
-_scratch_mount || _fail "mount failed"
+_scratch_mount
 
 echo "done"
 
@@ -81,7 +81,7 @@ do
     _do "Grow filesystem to ${size}m" "xfs_growfs -D $grow_size $SCRATCH_MNT"
     echo -n "Flush filesystem... "
     _do "_scratch_unmount"
-    _do "_scratch_mount"
+    _do "_try_scratch_mount"
     echo "done"
     echo -n "Check files... "
     if ! _do "src/fill2fs_check $tmp.manifest"; then
index 182cebc313e3cd263f8882dbd746502010b31f2b..45117d9c5a1c792245f8052f77601f0bb0cc5364 100755 (executable)
@@ -75,7 +75,7 @@ _do_die_on_error=message_only
 
 echo -n "Make a 48 megabyte filesystem on SCRATCH_DEV and mount... "
 _scratch_mkfs_xfs -dsize=48m,agcount=3 2>&1 >/dev/null || _fail "mkfs failed"
-_scratch_mount || _fail "mount failed" 
+_scratch_mount
 
 echo "done"
 
@@ -97,7 +97,7 @@ _do "xfs_bmap -vp $SCRATCH_MNT/fill"
 echo "done"
 # flush the filesystem - make sure there is no space "lost" to pre-allocation
 _do "_scratch_unmount"
-_do "_scratch_mount"
+_do "_try_scratch_mount"
 echo -n "Use up any further available space... "
 _do "$XFS_IO_PROG -f -c \"falloc 0 1m\" $SCRATCH_MNT/pad"
 echo "done"
index fc5dae024e07e4471a3dd2aa2478f9a594fccc1d..70f72d6930ad0b3a61fb4b0ded49eb711ae9a217 100755 (executable)
@@ -60,7 +60,7 @@ _filter_logprint()
 _check_mount()
 {
     echo "    *** mount (expect success)"
-    if ! _scratch_mount
+    if ! _try_scratch_mount
     then
         echo "        !!! mount failed (expecting success)"
         status=1
@@ -79,7 +79,7 @@ _check_mount()
 _check_no_mount()
 {
     echo "    *** mount (expect failure)"
-    if _scratch_mount >$tmp.err 2>&1
+    if _try_scratch_mount >$tmp.err 2>&1
     then
         cat $tmp.err
         echo "        !!! mount succeeded (expecting failure)"
index 2733f5c1c22b543b3787ded111b794b2762d2b20..adf8566374b5e704cf25a9cb4f47e0ebcf8a5606 100755 (executable)
@@ -61,7 +61,7 @@ then
 fi
 
 echo "*** mount fs with bad mount option (expect failure)"
-if _scratch_mount -o foobar >$tmp.out 2>&1
+if _try_scratch_mount -o foobar >$tmp.out 2>&1
 then
     cat $tmp.out
     echo "!!! mount succeeded (expecting failure)"
@@ -72,7 +72,7 @@ echo "*** duplicate uuid"
 xfs_db -x -c "uuid $uuid" `_scratch_xfs_db_options` >/dev/null
 
 echo "*** mount fs with duplicate uuid (expect failure)"
-if _scratch_mount >$tmp.out 2>&1
+if _try_scratch_mount >$tmp.out 2>&1
 then
     cat $tmp.out
     echo "!!! mount succeeded (expecting failure)"
index 74a253e0ef1956ecbb32f441a8f47e3708174204..228f52bb010f371c2eecf13515ff280387569a08 100755 (executable)
@@ -77,7 +77,7 @@ sdev=$(_short_dev $SCRATCH_DEV)
 # use a small log fs
 _scratch_mkfs_sized $((1024 * 1024 * 500)) >> $seqres.full 2>&1 ||
                _fail "mkfs failed"
-_scratch_mount || _fail "mount failed"
+_scratch_mount
 
 # populate the fs with some data and cycle the mount to reset the log head/tail
 $FSSTRESS_PROG -d $SCRATCH_MNT -z -fcreat=1 -p 4 -n 100000 > /dev/null 2>&1
index c68ec0940064fe5987eb612f919aeb4512dfb863..743d94bb3e8a540d79e9ce9196b378258abbf878 100755 (executable)
@@ -52,7 +52,7 @@ if [ "$isize" -lt 1024 ]; then
     _scratch_mkfs_xfs -i size=1024 >>$seqres.full \
        || _notrun "Cannot mkfs for this test using MKFS_OPTIONS specified"
 fi
-_scratch_mount >>$seqres.full || _fail "mount failed"
+_scratch_mount
 xfs_info $SCRATCH_MNT >>$seqres.full
 cd $SCRATCH_MNT
 
index 5393cf8b047baca706670a21ed52133d5aafb283..074c786970d52e5b666fef9d53f54a75c0501324 100755 (executable)
@@ -54,7 +54,7 @@ rm -f $seqres.full
 _scratch_unmount >/dev/null 2>&1
 
 _scratch_mkfs_xfs >/dev/null   || _fail "mkfs failed"
-_scratch_mount >/dev/null      || _fail "mount failed"
+_scratch_mount
 
 # check there's enough freespace on $SCRATCH_MNT ... (1GiB + 1MiB)
 avail=`df -P $SCRATCH_MNT | awk 'END {print $4}'`
index 7228dd92d6ae67c6c707a23a2f31e6704e8873e2..9bcc95ddece942305beaafceea13158ee9d4d001 100755 (executable)
@@ -139,7 +139,7 @@ _require_loop
 rm -f $seqres.full
 
 _scratch_mkfs_xfs -dsize=41m,agcount=2 >>$seqres.full 2>&1
-_scratch_mount 2>/dev/null || _fail "initial scratch mount failed"
+_scratch_mount
 
 echo
 echo === populating scratch device
index ccf29ea19db316b4d5b777559f897bb28de9cae6..3c2c894820de0e454649d0a05b3d63977b659642 100755 (executable)
@@ -50,10 +50,10 @@ echo "Silence is golden"
 _scratch_mkfs_sized $((512 * 1024 * 1024)) >$seqres.full
 
 # first ro mount with norecovery
-_scratch_mount "-o ro,norecovery" >>$seqres.full 2>&1 \
+_try_scratch_mount "-o ro,norecovery" >>$seqres.full 2>&1 \
        || _fail "First ro mount failed"
 # make sure a following remount,rw fails
-_scratch_mount "-o remount,rw" >>$seqres.full 2>&1 \
+_try_scratch_mount "-o remount,rw" >>$seqres.full 2>&1 \
        && _fail "Second rw remount succeeded"
 
 # success, all done
index 6d5ac1a36bd7957247469aff6d166bb1d1f0c414..c4b4de96a1908c3146b9a9f162bd8a92f70a6be3 100755 (executable)
@@ -70,7 +70,7 @@ _test_uuid()
                                        | _filter_uuid $EXPECTED_UUID
        NEW_UUID=`_scratch_xfs_db -c "uuid"  | awk '{print $NF}'`
        _check_scratch_fs
-       _scratch_mount || _fail "Mount failed after UUID $ACTION"
+       _try_scratch_mount || _fail "Mount failed after UUID $ACTION"
        _scratch_unmount
 
 }
@@ -127,7 +127,7 @@ $XFS_COPY_PROG $SCRATCH_DEV $IMGFILE 2>&1 >> $seqres.full || \
 _check_xfs_filesystem $IMGFILE none none || _fail "Copy looks corrupted"
 # The copy should have META_UUID feature set
 _fs_has_META_UUID $IMGFILE || _fail "META_UUID feature not set on copy"
-_scratch_mount || _fail "Mount failed after UUID rewrite"
+_try_scratch_mount || _fail "Mount failed after UUID rewrite"
 _scratch_unmount
 
 rm -f $IMGFILE
index 8ac9d58db38c744bc06f4d2f1fc561251f6846ee..3079455a599a38b13cf5c02a4fa7a2bae897bd3a 100755 (executable)
@@ -78,7 +78,7 @@ wait
 # log record extended header count, as the log record header can only handle 32k
 # of space.
 _scratch_unmount
-_scratch_mount "-o logbsize=64k"
+_try_scratch_mount "-o logbsize=64k"
 
 # The mount may not fail on v4 filesystems. Check for CRC mismatch warning
 # messages to detect failure in this case.
index e2b5f823845de799db17faf52bc1318251c3d0fa..5490bd20e8b3dc0c6ed8ac3c2a3b62d7fe3ce116 100755 (executable)
@@ -75,7 +75,7 @@ scratch_repair() {
        elif [ "${res}" -eq 2 ]; then
                # replay log?
                echo "+++ replaying log" >> "${FSCK_LOG}"
-               _scratch_mount >> "${FSCK_LOG}" 2>&1
+               _try_scratch_mount >> "${FSCK_LOG}" 2>&1
                res=$?
                echo "+++ mount returns ${res}" >> "${FSCK_LOG}"
                if [ "${res}" -gt 0 ]; then
@@ -127,7 +127,7 @@ echo "++ corrupt image" >> $seqres.full
 xfs_db -x -c blockget -c "blocktrash ${FUZZ_ARGS}" "${SCRATCH_DEV}" >> $seqres.full 2>&1
 
 echo "++ mount image" >> $seqres.full
-_scratch_mount >> $seqres.full 2>&1
+_try_scratch_mount >> $seqres.full 2>&1
 
 echo "+++ test scratch" >> $seqres.full
 _scratch_fuzz_test >> $seqres.full 2>&1
@@ -149,7 +149,7 @@ _scratch_xfs_repair >> $seqres.full 2>&1
 
 ROUND2_LOG="${tmp}-round2-${fsck_pass}.log"
 echo "++ mount image (2)" >> $ROUND2_LOG
-_scratch_mount >> $ROUND2_LOG 2>&1
+_try_scratch_mount >> $ROUND2_LOG 2>&1
 
 echo "++ chattr -R -i" >> $ROUND2_LOG
 $CHATTR_PROG -R -f -i "${SCRATCH_MNT}/" > /dev/null 2>> $ROUND2_LOG
index 0c85850d2a62ce8db2e1a8fe6272f9df5b02790c..57fc47c91d80c40cd070f8c497ffae6b962b1035 100755 (executable)
@@ -88,7 +88,7 @@ echo "+ corrupt image"
 $XFS_IO_PROG -f -c "pwrite -S 0x62 32 4" "${SCRATCH_DEV}" >> $seqres.full
 
 echo "+ mount image"
-_scratch_mount 2>/dev/null && _fail "mount should not succeed"
+_try_scratch_mount 2>/dev/null && _fail "mount should not succeed"
 
 echo "+ repair fs"
 _scratch_xfs_repair >> $seqres.full 2>&1
index 92b9e3d83d96ce3e65951f03d25d08264f75f7a2..f4230bc292c9675ab66f6b21d34b13be51889b72 100755 (executable)
@@ -57,7 +57,7 @@ _create_scratch()
        fi
 
        echo "*** mount"
-       if ! _scratch_mount
+       if ! _try_scratch_mount
        then
                echo "failed to mount $SCRATCH_DEV"
                exit 1
index 5a6931957a859df48e33b4e045ef5da0f94c5e32..ea3b122945495234d18b32393497757bed0e7c45 100755 (executable)
@@ -53,7 +53,7 @@ MOUNT_OPTIONS="$MOUNT_OPTIONS -o inode64"
 _scratch_mkfs_xfs | _filter_mkfs 2>/dev/null
 echo Silence is golden
 
-_scratch_mount
+_try_scratch_mount
 [ $? -eq 0 ] || echo "inode64 mount failed unexpectedly!"
 
 # success, all done
index d3606f81381506a95de3a662b3fd147c173f2378..13dcf6e2e77c7214e42a7ca2cdc0820b64e0d110 100755 (executable)
@@ -78,7 +78,7 @@ _create_scratch()
        fi
 
        echo "*** mount"
-       if ! _scratch_mount
+       if ! _try_scratch_mount
        then
                echo "failed to mount $SCRATCH_DEV"
                exit 1
index 24ce1d5d44ed97f54a78eaf344556059fd06d18e..b32fc493f8536e277a7928503c2429b2828c72de 100755 (executable)
@@ -94,7 +94,7 @@ logblocks="$(_scratch_xfs_get_sb_field logblocks)"
 $XFS_IO_PROG -f -c "pwrite -S 0x62 ${logstart} $((logblocks * blksz))" "${SCRATCH_DEV}" >> $seqres.full
 
 echo "+ mount image"
-_scratch_mount 2>/dev/null && _fail "mount should not succeed"
+_try_scratch_mount 2>/dev/null && _fail "mount should not succeed"
 
 echo "+ repair fs"
 _repair_scratch_fs >> $seqres.full 2>&1
index 024416bd47b652f32ae61f666a2b91bb9b7a0960..90109e3bd91d99bdd3ed0ab9a549c6f08bc08c92 100755 (executable)
@@ -46,7 +46,7 @@ _create_scratch()
        fi
 
        echo "*** mount"
-       if ! _scratch_mount 2>/dev/null
+       if ! _try_scratch_mount 2>/dev/null
        then
                echo "failed to mount $SCRATCH_DEV"
                exit 1
index c3b59775fdadc7d623e5ca662c097acce15edb3b..b716437400e9cf1f16b3c1dbd9b9e4ed6b68a251 100755 (executable)
@@ -42,7 +42,7 @@ _create_scratch()
        . $tmp.mkfs
 
        echo "*** mount"
-       if ! _scratch_mount 2>/dev/null
+       if ! _try_scratch_mount 2>/dev/null
        then
                echo "failed to mount $SCRATCH_DEV"
                exit 1
index d5a09bbd32d621b87a265b684101d58408c6ab72..8bc5e28b6a39eff81a86a4665f1f8ef1f771a1f2 100755 (executable)
@@ -70,7 +70,7 @@ BYTE=`_scratch_xfs_db -c "convert inode $INO byte" \
 echo Blat inode clusters
 src/itrash $SCRATCH_DEV $BYTE
 
-_scratch_mount || _fail "Couldn't mount after itrash"
+_try_scratch_mount || _fail "Couldn't mount after itrash"
 
 echo Attempting bulkstat
 #src/bstat -q $SCRATCH_MNT
index 2f84a3c8b447b654fd584e6fd097c84f80a7f02e..a380b7fb805813dfe81bca727e951c1063b9413c 100755 (executable)
@@ -54,8 +54,7 @@ _scratch_mkfs_xfs >>$seqres.full 2>&1 \
     || _fail "mkfs scratch failed"
 
 echo "mount"
-_scratch_mount >>$seqres.full 2>&1 \
-    || _fail "mount failed: $MOUNT_OPTIONS"
+_scratch_mount
 
 # num_files must be greater than 64 (XFS_AGI_UNLINKED_BUCKETS)
 # so that there will be at least one linked list from one of
@@ -82,7 +81,7 @@ echo "logprint after going down..."
 _print_logstate
 
 echo "mount with replay"
-_scratch_mount $mnt >>$seqres.full 2>&1 \
+_try_scratch_mount $mnt >>$seqres.full 2>&1 \
     || _fail "mount failed: $mnt $MOUNT_OPTIONS"
 
 echo "godown"
@@ -103,8 +102,7 @@ else
 fi
 
 # clean up dirty log with log recovery on mount
-_scratch_mount >> $seqres.full 2>&1 \
-    || _fail "mount failed"
+_scratch_mount
 
 # success, all done
 status=0
index 1c3d642430fccdb39e4048428a04ab7ee7d8448a..a9e0ff4853d90d48eaabe96527c06251239f6bd3 100755 (executable)
@@ -79,7 +79,7 @@ seq 0 $((agcount - 1)) | while read ag; do
 done
 
 echo "+ mount image"
-_scratch_mount >> $seqres.full 2>&1 && \
+_try_scratch_mount >> $seqres.full 2>&1 && \
        echo "Should not be able to mount with broken refcountbt."
 _scratch_unmount >> $seqres.full 2>&1
 
index 093ef009b7da6759e27010c79540f13ff12f598c..6a19311860c30144c7f99e1a3d133613998600a7 100755 (executable)
@@ -69,13 +69,13 @@ _scratch_unmount
 # because the sb LSN is ahead of the current LSN. If it doesn't fail, push the
 # cycle back further and try again.
 _scratch_xfs_db -x -c "logformat" >> $seqres.full 2>&1
-_scratch_mount >> $seqres.full 2>&1
+_try_scratch_mount >> $seqres.full 2>&1
 if [ $? != 0 ]; then
        echo mount failure detected
 else
        _scratch_unmount
        _scratch_xfs_db -x -c "logformat -c 2" >> $seqres.full 2>&1
-       _scratch_mount >> $seqres.full 2>&1 || echo mount failure detected
+       _try_scratch_mount >> $seqres.full 2>&1 || echo mount failure detected
 fi
 
 # verify that repair detects invalid LSNs as well
index f61e52428a519995aec7f972a07e99a0d1649541..80b5cb04ba804d4beb319949bc766baa4d893966 100755 (executable)
@@ -79,7 +79,7 @@ for i in $(seq 1 5); do
        # Verify that we can remount the fs. Log recovery should handle the torn
        # write.
        _scratch_unmount
-       _scratch_mount || _fail "failed to mount"
+       _scratch_mount
 done
 
 # success, all done
index 3957b49a8991319bbd0a5d5bde761a88db836064..2aa4c7993039e6438b177b4c4a34627affe16e4e 100755 (executable)
@@ -59,8 +59,7 @@ _scratch_unmount > /dev/null 2>&1
 _scratch_mkfs_xfs >/dev/null 2>&1 \
         || _fail "mkfs failed"
 
-_scratch_mount \
-        || _fail "mount failed"
+_scratch_mount
 
 # run Mark Goodwin test here
 # Usage: ./bulkstat_unlink_test iterations nfiles stride dir
@@ -73,8 +72,7 @@ $here/src/bulkstat_unlink_test 20 1000 3 $SCRATCH_MNT/bulkstat
 
 # Mount scratch with ikeep enabled
 _scratch_unmount
-_scratch_mount "-o dmapi,mtpt=$SCRATCH_MNT" \
-        || _fail "mount failed"
+_scratch_mount "-o dmapi,mtpt=$SCRATCH_MNT"
 
 echo "Start bulkstat_unlink_test_modified"
 $here/src/bulkstat_unlink_test_modified 10 1000 1 $SCRATCH_MNT/bulkstat
index 07d7517174fd7a9f1a559f423bfadae99855504c..3daea78807ade90f195363a7be4e415614cedc00 100755 (executable)
@@ -61,8 +61,7 @@ _scratch_mkfs_xfs >>$seqres.full 2>&1 \
     || _fail "mkfs scratch failed"
 
 echo "mount"
-_scratch_mount >>$seqres.full 2>&1 \
-    || _fail "mount failed: $MOUNT_OPTIONS"
+_scratch_mount
 
 # num_files must be greater than 64 (XFS_AGI_UNLINKED_BUCKETS)
 # so that there will be at least one linked list from one of
index 764c1d5c6f274ffceb80b78a808a46e75848541b..390cfc8e444a92282bbf43634ec6cf7c897672ec 100755 (executable)
@@ -53,8 +53,7 @@ _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1 \
         || _fail "mkfs failed"
 
-_scratch_mount \
-        || _fail "mount failed"
+_scratch_mount
 
 # run Mark Goodwin test here
 # Usage: ./bulkstat_unlink_test iterations nfiles stride dir
index 699eb3c1f941b8ac35e2d05a73dd15a0d58ba41a..e2654e5168239262de1284e36d2a9397f80662ab 100755 (executable)
@@ -108,7 +108,7 @@ _test_remount_rw()
        echo
        echo "try remount ro,filestreams -> rw,filestreams"
        echo
-       _scratch_mount -o ro,filestreams
+       _try_scratch_mount -o ro,filestreams
        [ $? -eq 0 ] || echo "ro,filestreams mount failed unexpectedly"
        _check_mount ro filestreams
 
@@ -127,7 +127,7 @@ _test_remount_rw()
        echo
        echo "try remount ro,noattr2 -> rw,attr2"
        echo
-       _scratch_mount -o ro,noattr2
+       _try_scratch_mount -o ro,noattr2
        [ $? -eq 0 ] || echo "ro,noattr2 mount failed unexpectedly"
        _check_mount ro
 
@@ -149,7 +149,7 @@ _test_remount_write()
        echo
        echo "try touching file after remount ro -> rw with options"
        echo
-       _scratch_mount
+       _try_scratch_mount
        [ $? -eq 0 ] || echo "mount (1) failed unexpectedly"
 
        touch $SCRATCH_MNT/foobar
@@ -157,7 +157,7 @@ _test_remount_write()
 
        _scratch_unmount
 
-       _scratch_mount -o ro
+       _try_scratch_mount -o ro
        [ $? -eq 0 ] || echo "mount (2) failed unexpectedly"
 
        _mount -o remount,rw,filestreams $SCRATCH_MNT
@@ -181,15 +181,15 @@ _test_remount_barrier()
        echo
 
        # mention barrier explicitly even if it's currently the default just to be sure
-       _scratch_mount -o barrier
+       _try_scratch_mount -o barrier
        [ $? -eq 0 ] || echo "mount failed unexpectedly!"
        _check_mount rw
 
-       _scratch_mount -o remount,nobarrier
+       _try_scratch_mount -o remount,nobarrier
        [ $? -eq 0 ] || _fail "remount nobarrier failed"
        _check_mount rw nobarrier
 
-       _scratch_mount -o remount,barrier
+       _try_scratch_mount -o remount,barrier
        [ $? -eq 0 ] || _fail "remount barrier failed"
        _check_mount rw
 
index 7aebf90b820e1be96f208ba74d6fe2c53d06fb11..e713dfdd3b19fd274faf9b80c12a63af6cde261f 100755 (executable)
@@ -82,7 +82,7 @@ function test_all_state()
                echo "== Options: $OPTIONS =="
                # Some combinations won't mount on V4 supers (grp + prj)
                _qmount_option "$OPTIONS"
-               _scratch_mount &>> $seqres.full || continue
+               _try_scratch_mount &>> $seqres.full || continue
                $XFS_QUOTA_PROG -x -c "state" $SCRATCH_MNT | filter_quota_state
                _scratch_unmount
        done
index 18e6c3861195eaf3c61dddb27e8df8314468ca0f..05dee74181534a7824531181bd4fcd814641ea1f 100755 (executable)
@@ -63,14 +63,14 @@ $XFS_DB_PROG -x -c "sb 0" -c "write features_ro_compat $((2**31))" $SCRATCH_DEV
 
 # rw mount with unknown ro-compat feature should fail
 echo "rw mount test"
-_scratch_mount 2>>$seqres.full
+_try_scratch_mount 2>>$seqres.full
 if [ $? -eq 0 ]; then
        _fail "rw mount test failed"
 fi
 
 # But ro mount should succeed
 echo "ro mount test"
-_scratch_mount -o ro
+_try_scratch_mount -o ro
 if [ $? -ne 0 ]; then
        _fail "ro mount test failed"
 else
index 708a7f86483730ec67e1cdd39d86fea8426e4ec8..2ae2d437e45db93bb2ecb83e0fe44647adef5068 100755 (executable)
@@ -52,7 +52,7 @@ _require_command "$KILLALL_PROG" killall
 
 rm -f $seqres.full
 _scratch_mkfs_xfs -d agcount=16,su=256k,sw=12 -l su=256k,size=5120b >/dev/null 2>&1
-_scratch_mount >>$seqres.full 2>&1 || _fail "mount failed"
+_scratch_mount
 
 STRESS_DIR="$SCRATCH_MNT/testdir"
 mkdir -p $STRESS_DIR
index 2f394feda6c96534864db68b544f7cc7349fde16..41949f9221511e533d864b49b8df54600e2ebc38 100755 (executable)
@@ -64,7 +64,7 @@ _scratch_unmount
 
 echo "Corrupt fs"
 _scratch_xfs_db -x -c 'sb 0' -c "write rrmapino $ino" >> $seqres.full
-_scratch_mount 2>&1 | _filter_error_mount
+_try_scratch_mount 2>&1 | _filter_error_mount
 
 echo "Test done, mount should have failed"
 
index 755510c88cb9a382d24be5a389e852fbec517243..25e6aec9c6aa63cfaff6aa6ebfedbb94e423e0f0 100755 (executable)
@@ -60,7 +60,7 @@ echo "Corrupt fs"
 _scratch_xfs_db -x -c 'sb 0' -c 'addr rrmapino' \
        -c 'write core.nlinkv2 0' -c 'write core.mode 0' -c 'sb 0' \
        -c 'write rrmapino 0' >> $seqres.full
-_scratch_mount >> $seqres.full 2>&1 && echo "mount should have failed"
+_try_scratch_mount >> $seqres.full 2>&1 && echo "mount should have failed"
 
 echo "Repair fs"
 _scratch_unmount 2>&1 | _filter_scratch
index 7b1b7d13b1a2518b944eb417e51a38173b5d26bd..8e82c0884fc8424efca5810ae7d2b26fcce74483 100755 (executable)
@@ -65,7 +65,7 @@ _scratch_xfs_db -x -c "inode $rrmapino" \
        -c 'write core.nblocks 0' -c 'sb 0' -c 'addr rootino' \
        -c "write u3.sfdir3.list[2].inumber.i4 $rrmapino" \
        -c 'sb 0' -c "write rrmapino $ino" >> $seqres.full
-_scratch_mount >> $seqres.full 2>&1 && echo "mount should have failed"
+_try_scratch_mount >> $seqres.full 2>&1 && echo "mount should have failed"
 
 echo "Repair fs"
 _scratch_unmount 2>&1 | _filter_scratch
index 2751168517229f74abc8fa7e3a844f1cd2236569..be1ccfcfe77538a9a5e7b7afe8a32ae98c38df54 100755 (executable)
@@ -65,7 +65,7 @@ _require_scratch
 _require_attrs
 
 _scratch_mkfs > $seqres.full 2>&1
-_scratch_mount || _fail "mount failure"
+_scratch_mount
 
 file=$SCRATCH_MNT/testfile
 
index 908f25435772254ea66d818f2dd6804b6e66cf17..e859aebb1804675d59b6a535bfdf912aefdce3dd 100755 (executable)
@@ -99,7 +99,7 @@ _scratch_xfs_db -x -c 'agf 0' -c 'addr refcntroot' -c 'fuzz -d recs[1].startbloc
 _scratch_xfs_db -x -c 'agf 0' -c 'addr refcntroot' -c p >> $seqres.full
 
 # Suddenly enable quota to test if we can leak the quotacheck dquots!
-_scratch_mount -o quota >> $seqres.full 2>&1
+_try_scratch_mount -o quota >> $seqres.full 2>&1
 _scratch_unmount 2> /dev/null
 rm -f ${RESULT_DIR}/require_scratch
 
index 6ab8a614292f517159f479e37194cce82b5a0691..dea28149e8c9daed191dc6f2579b55d28f871cdf 100755 (executable)
@@ -77,7 +77,7 @@ echo "Remount to check recovery" | tee /dev/ttyprintk
 _scratch_unmount
 _scratch_xfs_db -x -c 'agf 0' -c 'addr refcntroot' -c 'fuzz -d recs[1].startblock ones' >> $seqres.full
 _scratch_xfs_db -x -c 'agf 0' -c 'addr refcntroot' -c p >> $seqres.full
-_scratch_mount -o quota >> $seqres.full 2>&1
+_try_scratch_mount -o quota >> $seqres.full 2>&1
 _scratch_unmount 2> /dev/null
 rm -f ${RESULT_DIR}/require_scratch
 
index ec19106ce12c218a14bfb06d0adfc9466d755e73..d357b8303d44721aa0aa48c78b13e644880d2ef2 100755 (executable)
@@ -93,7 +93,7 @@ _scratch_unmount
 _scratch_dump_log >> $seqres.full
 _scratch_xfs_db -x -c 'agf 0' -c 'addr refcntroot' -c 'fuzz -d recs[1].startblock ones' >> $seqres.full
 _scratch_xfs_db -x -c 'agf 0' -c 'addr refcntroot' -c p >> $seqres.full
-_scratch_mount -o noquota >> $seqres.full 2>&1
+_try_scratch_mount -o noquota >> $seqres.full 2>&1
 _scratch_unmount 2> /dev/null
 rm -f ${RESULT_DIR}/require_scratch
 
index 7be700cddff404be651fba2586f7b0eb81546e5e..215c4b90cadb19f3fc1cd5525132bb74e0d2a8df 100755 (executable)
@@ -67,7 +67,7 @@ lsunit=$(_scratch_xfs_get_sb_field logsunit)
 # Mount and writing log may trigger a crash on buggy kernel
 # The fix applied kernel refuses to mount, so a mount failure is
 # expected
-if _scratch_mount >> $seqres.full 2>&1; then
+if _try_scratch_mount >> $seqres.full 2>&1; then
        for i in $(seq 1 1000); do
                echo > ${SCRATCH_MNT}/$i
        done
index 05cffe98456d2b37323b3111f0f82fcf541103df..8478426ad0607cd0409182be8fdc1ff2ae51f931 100755 (executable)
@@ -93,7 +93,7 @@ _qmount_option "usrquota,grpquota,prjquota"
 # xfs_qm_dqattach before performing reflink operations") though each of those
 # tests now have separate faster-running regression tests.
 _scratch_mkfs_sized $((1600 * 1048576)) > $seqres.full 2>&1
-_scratch_mount >> $seqres.full 2>&1 || _fail "mount failed..."
+_scratch_mount >> $seqres.full 2>&1
 
 nr_cpus=$((LOAD_FACTOR * 4))
 nr_ops=$((25000 * nr_cpus * TIME_FACTOR))
index df9434f807f4e73649874dcf8b4de6e9a960bb8d..5653849d964d4600eb90677a304cc4d97322c602 100755 (executable)
@@ -64,7 +64,7 @@ _require_xfs_io_command "fpunch"
 _require_xfs_io_command "swapext"
 
 _scratch_mkfs | _filter_mkfs >> $seqres.full 2> $tmp.mkfs
-_scratch_mount || _fail "mount failed"
+_scratch_mount
 
 # get fs block size
 . $tmp.mkfs