]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
fstests: clean up mount and unmount operations
authorDave Chinner <dchinner@redhat.com>
Tue, 26 Nov 2024 20:56:55 +0000 (07:56 +1100)
committerZorro Lang <zlang@kernel.org>
Sun, 8 Dec 2024 14:06:24 +0000 (22:06 +0800)
The way tests run unmount is, at times, completely random.
Sometimes they call the correct _scratch_unmount function, sometimes
they open code it with a direct call to UMOUNT_PROG <dir>, sometimes
they run umount directly.

This makes it really hard to instrument unmount operations when
trying to work out why transient, unpredictable failures like
this occur randomly during a test run:

umount: /mnt/xfs/runner-17/test: target is busy.

Sometimes it happens on a test device mount, sometimes a scratch
device mount.  Sometimes it happens to a test specific dm or loop
device mount. But without instrumenting every single unmount call in
every test, it's impossible to capture these failures easily.

Solve this problem by introducing the _unmount() wrapper. It is
simply a call to UMOUNT_PROG <dir>, but it provides a single point
were -every- unmount operation funnels through.

We already have a _mount wrapper for this reason. However, in trying
to work out why mounts were failing (because unmounts were failing),
I discovered that that_mount() is used inconsistently as well.

Sort this all out by adding and _unmount() wrapper to go with
_mount() and use them everywhere consistently.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Zorro lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
58 files changed:
common/btrfs
common/dmdelay
common/dmdust
common/dmerror
common/dmflakey
common/dmhugedisk
common/dmlogwrites
common/dmthin
common/overlay
common/populate
common/rc
tests/generic/042
tests/generic/050
tests/generic/067
tests/generic/081
tests/generic/085
tests/generic/108
tests/generic/171
tests/generic/172
tests/generic/173
tests/generic/174
tests/generic/306
tests/generic/332
tests/generic/361
tests/generic/373
tests/generic/374
tests/generic/395
tests/generic/459
tests/generic/563
tests/generic/604
tests/generic/631
tests/generic/648
tests/generic/698
tests/generic/699
tests/generic/704
tests/generic/717
tests/generic/730
tests/generic/731
tests/generic/732
tests/generic/741
tests/generic/744
tests/generic/746
tests/xfs/014
tests/xfs/073
tests/xfs/074
tests/xfs/078
tests/xfs/148
tests/xfs/149
tests/xfs/186
tests/xfs/216
tests/xfs/217
tests/xfs/250
tests/xfs/289
tests/xfs/507
tests/xfs/513
tests/xfs/544
tests/xfs/606
tests/xfs/613

index 95a9c8e6c7f44839f6ac7905707470e4ff4a9576..4a2c9886e3cf411b926209341f00f0ff674d7ea6 100644 (file)
@@ -352,7 +352,7 @@ _btrfs_stress_subvolume()
        while [ ! -e $stop_file ]; do
                $BTRFS_UTIL_PROG subvolume create $btrfs_mnt/$subvol_name
                $MOUNT_PROG -o subvol=$subvol_name $btrfs_dev $subvol_mnt
-               $UMOUNT_PROG $subvol_mnt
+               _unmount $subvol_mnt
                $BTRFS_UTIL_PROG subvolume delete $btrfs_mnt/$subvol_name
        done
 }
@@ -368,7 +368,7 @@ _btrfs_kill_stress_subvolume_pid()
        # Ignore if process already died.
        wait $subvol_pid &> /dev/null
        rm -f $stop_file
-       $UMOUNT_PROG $subvol_mnt &> /dev/null
+       _unmount $subvol_mnt &> /dev/null
 }
 
 # stress btrfs by running scrub in a loop
index 1c4fca6e9aa9712e3649638fd653f8d3637e13cd..848afb993faa19d5e68abae67c1eaea36756f84f 100644 (file)
@@ -28,7 +28,7 @@ _mount_delay()
 
 _unmount_delay()
 {
-       $UMOUNT_PROG $SCRATCH_MNT
+       _unmount $SCRATCH_MNT
 }
 
 _cleanup_delay()
@@ -36,7 +36,7 @@ _cleanup_delay()
        # If dmsetup load fails then we need to make sure to do resume here
        # otherwise the umount will hang
        $DMSETUP_PROG resume $DELAY_NAME > /dev/null 2>&1
-       $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1
+       _unmount $SCRATCH_MNT > /dev/null 2>&1
        _dmsetup_remove $DELAY_NAME
 }
 
index 37bb865c8197cd0b77def04652776167868e0066..55bbc84db5d4b65935974f9e155e0f97c42d4043 100644 (file)
@@ -24,7 +24,7 @@ _mount_dust()
 
 _unmount_dust()
 {
-       $UMOUNT_PROG $SCRATCH_MNT
+       _unmount $SCRATCH_MNT
 }
 
 _cleanup_dust()
@@ -32,6 +32,6 @@ _cleanup_dust()
        # If dmsetup load fails then we need to make sure to do resume here
        # otherwise the umount will hang
        $DMSETUP_PROG resume $DUST_NAME > /dev/null 2>&1
-       $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1
+       _unmount $SCRATCH_MNT > /dev/null 2>&1
        _dmsetup_remove $DUST_NAME
 }
index 97796b38e32110c149f8606153e40c8cf18b1ae4..309129c03c8d87e8dd274657f2cf607f2d3668a2 100644 (file)
@@ -101,7 +101,7 @@ _dmerror_mount()
 
 _dmerror_unmount()
 {
-       umount $SCRATCH_MNT
+       _unmount $SCRATCH_MNT
 }
 
 _dmerror_cleanup()
@@ -110,7 +110,7 @@ _dmerror_cleanup()
        test -n "$NON_ERROR_RTDEV" && $DMSETUP_PROG resume $DMERROR_RTNAME &>/dev/null
        $DMSETUP_PROG resume $DMERROR_NAME > /dev/null 2>&1
 
-       $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1
+       _unmount $SCRATCH_MNT > /dev/null 2>&1
 
        test -n "$NON_ERROR_LOGDEV" && _dmsetup_remove $DMERROR_LOGNAME
        test -n "$NON_ERROR_RTDEV" && _dmsetup_remove $DMERROR_RTNAME
index 75a0a67c8f60b13236bb41b0497183175cb127cb..7368a3e5b32420cce628520b36e30a72c4f9d55b 100644 (file)
@@ -71,7 +71,7 @@ _mount_flakey()
 
 _unmount_flakey()
 {
-       $UMOUNT_PROG $SCRATCH_MNT
+       _unmount $SCRATCH_MNT
 }
 
 _cleanup_flakey()
@@ -82,7 +82,7 @@ _cleanup_flakey()
        test -n "$NON_FLAKEY_RTDEV" && $DMSETUP_PROG resume $FLAKEY_RTNAME &> /dev/null
        $DMSETUP_PROG resume flakey-test > /dev/null 2>&1
 
-       $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1
+       _unmount $SCRATCH_MNT > /dev/null 2>&1
 
        _dmsetup_remove $FLAKEY_NAME
        test -n "$NON_FLAKEY_LOGDEV" && _dmsetup_remove $FLAKEY_LOGNAME
index 0757e190899a42aaf47261447d52cb1503c70500..2d23f436c75fe391b139449a14da5244d0f6476b 100644 (file)
@@ -42,7 +42,7 @@ _dmhugedisk_init()
 
 _dmhugedisk_cleanup()
 {
-       $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1
+       _unmount $SCRATCH_MNT > /dev/null 2>&1
        _dmsetup_remove $DMHUGE_TEST
        _dmsetup_remove $DMHUGE_TEST_ZERO
 }
index c1c85de9dd43ac68deb71360e89746ac109af39d..a27e1966a933a625cf15eb93a4ecbb2cff9fef6b 100644 (file)
@@ -110,7 +110,7 @@ _log_writes_mount()
 
 _log_writes_unmount()
 {
-       $UMOUNT_PROG $SCRATCH_MNT
+       _unmount $SCRATCH_MNT
 }
 
 # _log_writes_replay_log <mark>
@@ -141,7 +141,7 @@ _log_writes_remove()
 
 _log_writes_cleanup()
 {
-       $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1
+       _unmount $SCRATCH_MNT > /dev/null 2>&1
        _log_writes_remove
 }
 
index f2c00f5a7106bc398620d1e48a8cfbb3da2c960a..453e43a0499e5936a1aa4cc252a4388624e9c233 100644 (file)
@@ -23,7 +23,7 @@ DMTHIN_VOL_DEV="/dev/mapper/$DMTHIN_VOL_NAME"
 
 _dmthin_cleanup()
 {
-       $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1
+       _unmount $SCRATCH_MNT > /dev/null 2>&1
        _dmsetup_remove $DMTHIN_VOL_NAME
        _dmsetup_remove $DMTHIN_POOL_NAME
        _dmsetup_remove $DMTHIN_META_NAME
@@ -32,7 +32,7 @@ _dmthin_cleanup()
 
 _dmthin_check_fs()
 {
-       $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1
+       _unmount $SCRATCH_MNT > /dev/null 2>&1
        _check_scratch_fs $DMTHIN_VOL_DEV
 }
 
index faa9339a6477f71c30ca8a0e7e9f9afcbedf9e0e..01b6622f55731d0ab539e8517a0b00e29c12e435 100644 (file)
@@ -142,18 +142,18 @@ _overlay_base_unmount()
 
        [ -n "$dev" -a -n "$mnt" ] || return 0
 
-       $UMOUNT_PROG $mnt
+       _unmount $mnt
 }
 
 _overlay_test_unmount()
 {
-       $UMOUNT_PROG $TEST_DIR
+       _unmount $TEST_DIR
        _overlay_base_unmount "$OVL_BASE_TEST_DEV" "$OVL_BASE_TEST_DIR"
 }
 
 _overlay_scratch_unmount()
 {
-       $UMOUNT_PROG $SCRATCH_MNT
+       _unmount $SCRATCH_MNT
        _overlay_base_unmount "$OVL_BASE_SCRATCH_DEV" "$OVL_BASE_SCRATCH_MNT"
 }
 
@@ -342,7 +342,7 @@ _overlay_check_scratch_dirs()
 
        # Need to umount overlay for scratch dir check
        local ovl_mounted=`_is_dir_mountpoint $SCRATCH_MNT`
-       [ -z "$ovl_mounted" ] || $UMOUNT_PROG $SCRATCH_MNT
+       [ -z "$ovl_mounted" ] || _unmount $SCRATCH_MNT
 
        # Check dirs with extra overlay options
        _overlay_check_dirs $lowerdir $upperdir $workdir $*
@@ -387,7 +387,7 @@ _overlay_check_fs()
        else
                # Check and umount overlay for dir check
                ovl_mounted=`_is_dir_mountpoint $ovl_mnt`
-               [ -z "$ovl_mounted" ] || $UMOUNT_PROG $ovl_mnt
+               [ -z "$ovl_mounted" ] || _unmount $ovl_mnt
        fi
 
        _overlay_check_dirs $base_mnt/$OVL_LOWER $base_mnt/$OVL_UPPER \
index 88c8ba2b32767cbc312aca5af23595d90b1d6499..4cf9c0691956a3de12700164e9fad1e43c73885c 100644 (file)
@@ -517,7 +517,7 @@ _scratch_xfs_populate() {
        __populate_fragment_file "${SCRATCH_MNT}/RTRMAPBT"
        __populate_fragment_file "${SCRATCH_MNT}/REFCOUNTBT"
 
-       umount "${SCRATCH_MNT}"
+       _scratch_unmount
 }
 
 # Populate an ext4 on the scratch device with (we hope) all known
@@ -619,7 +619,7 @@ _scratch_ext4_populate() {
        # Make sure we get all the fragmentation we asked for
        __populate_fragment_file "${SCRATCH_MNT}/S_IFREG.FMT_ETREE"
 
-       umount "${SCRATCH_MNT}"
+       _scratch_unmount
 }
 
 # Find the inode number of a file
@@ -772,7 +772,7 @@ _scratch_xfs_populate_check() {
        dblksz="$(_xfs_get_dir_blocksize "$SCRATCH_MNT")"
        leaf_lblk="$((32 * 1073741824 / blksz))"
        node_lblk="$((64 * 1073741824 / blksz))"
-       umount "${SCRATCH_MNT}"
+       _scratch_unmount
 
        __populate_check_xfs_dformat "${extents_file}" "extents"
        __populate_check_xfs_dformat "${btree_file}" "btree"
@@ -885,7 +885,7 @@ _scratch_ext4_populate_check() {
        extents_slink="$(__populate_find_inode "${SCRATCH_MNT}/S_IFLNK.FMT_EXTENTS")"
        local_attr="$(__populate_find_inode "${SCRATCH_MNT}/ATTR.FMT_LOCAL")"
        block_attr="$(__populate_find_inode "${SCRATCH_MNT}/ATTR.FMT_BLOCK")"
-       umount "${SCRATCH_MNT}"
+       _scratch_unmount
 
        __populate_check_ext4_dformat "${extents_file}" "extents"
        __populate_check_ext4_dformat "${etree_file}" "etree"
index 2442ef2eec42874e94b05c40c4f7f9794a300a5f..393ad859ea50c6ea63c4bab10753a53daff68574 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -325,7 +325,7 @@ _put_mount()
        local last_mnt=`echo $MOUNTED_POINT_STACK | awk '{print $1}'`
 
        if [ -n "$last_mnt" ]; then
-               $UMOUNT_PROG $last_mnt
+               _unmount $last_mnt
        fi
        MOUNTED_POINT_STACK=`echo $MOUNTED_POINT_STACK | cut -d\  -f2-`
 }
@@ -334,7 +334,7 @@ _put_mount()
 _clear_mount_stack()
 {
        if [ -n "$MOUNTED_POINT_STACK" ]; then
-               $UMOUNT_PROG $MOUNTED_POINT_STACK
+               _unmount -R $MOUNTED_POINT_STACK
        fi
        MOUNTED_POINT_STACK=""
 }
@@ -472,6 +472,14 @@ _scratch_mount_idmapped()
        fi
 }
 
+# Unmount the filesystem based on the directory or device passed.
+_unmount()
+{
+       local args="$*"
+
+       $UMOUNT_PROG $args >> $seqres.full 2>&1
+}
+
 _scratch_unmount()
 {
        case "$FSTYP" in
@@ -479,20 +487,20 @@ _scratch_unmount()
                _overlay_scratch_unmount
                ;;
        btrfs)
-               $UMOUNT_PROG $SCRATCH_MNT
+               _unmount $SCRATCH_MNT
                ;;
        tmpfs)
-               $UMOUNT_PROG $SCRATCH_MNT
+               _unmount $SCRATCH_MNT
                ;;
        *)
-               $UMOUNT_PROG $SCRATCH_DEV
+               _unmount $SCRATCH_DEV
                ;;
        esac
 }
 
 _scratch_umount_idmapped()
 {
-       $UMOUNT_PROG $SCRATCH_MNT
+       _unmount $SCRATCH_MNT
 }
 
 _scratch_remount()
@@ -516,7 +524,7 @@ _scratch_cycle_mount()
         ;;
     overlay)
         if [ "$OVL_BASE_FSTYP" = tmpfs ]; then
-            $UMOUNT_PROG $SCRATCH_MNT
+            _unmount $SCRATCH_MNT
             unmounted=true
         fi
         ;;
@@ -564,9 +572,9 @@ _move_mount()
 
        # Replace $mnt with $tmp. Use a temporary bind-mount because
        # mount --move will fail with certain mount propagation layouts.
-       $UMOUNT_PROG $mnt || _fail "Failed to unmount $mnt"
+       _unmount $mnt || _fail "Failed to unmount $mnt"
        _mount --bind $tmp $mnt || _fail "Failed to bind-mount $tmp to $mnt"
-       $UMOUNT_PROG $tmp || _fail "Failed to unmount $tmp"
+       _unmount $tmp || _fail "Failed to unmount $tmp"
        rmdir $tmp
 }
 
@@ -632,7 +640,7 @@ _test_unmount()
        if [ "$FSTYP" == "overlay" ]; then
                _overlay_test_unmount
        else
-               $UMOUNT_PROG $TEST_DEV
+               _unmount $TEST_DEV
        fi
 }
 
@@ -646,7 +654,7 @@ _test_cycle_mount()
         ;;
     overlay)
         if [ "$OVL_BASE_FSTYP" = tmpfs ]; then
-            $UMOUNT_PROG $TEST_DIR
+            _unmount $TEST_DIR
             unmounted=true
         fi
         ;;
@@ -1402,7 +1410,7 @@ _repair_scratch_fs()
                        _scratch_xfs_repair -L 2>&1
                        echo "log zap returns $?"
                else
-                       umount "$SCRATCH_MNT"
+                       _unmount "$SCRATCH_MNT"
                fi
                _scratch_xfs_repair "$@" 2>&1
                res=$?
@@ -1434,7 +1442,7 @@ _repair_scratch_fs()
                # Fall through to repair base fs
                dev=$OVL_BASE_SCRATCH_DEV
                fstyp=$OVL_BASE_FSTYP
-               $UMOUNT_PROG $OVL_BASE_SCRATCH_MNT
+               _unmount $OVL_BASE_SCRATCH_MNT
        fi
        # Let's hope fsck -y suffices...
        fsck -t $fstyp -y $dev 2>&1
@@ -1467,7 +1475,7 @@ _repair_test_fs()
                                _test_xfs_repair -L >>$tmp.repair 2>&1
                                echo "log zap returns $?" >> $tmp.repair
                        else
-                               umount "$TEST_DEV"
+                               _unmount "$TEST_DEV"
                        fi
                        _test_xfs_repair "$@" >>$tmp.repair 2>&1
                        res=$?
@@ -2248,7 +2256,7 @@ _require_logdev()
         _notrun "This test requires USE_EXTERNAL to be enabled"
 
     # ensure its not mounted
-    $UMOUNT_PROG $SCRATCH_LOGDEV 2>/dev/null
+    _unmount $SCRATCH_LOGDEV 2>/dev/null
 }
 
 # This test requires that an external log device is not in use
@@ -3335,7 +3343,7 @@ _umount_or_remount_ro()
     local mountpoint=`_is_dev_mounted $device`
 
     if [ $USE_REMOUNT -eq 0 ]; then
-        $UMOUNT_PROG $device
+       _unmount $device
     else
         _remount $device ro
     fi
@@ -3852,7 +3860,7 @@ _require_scratch_dev_pool()
                        _notrun "$i is part of TEST_DEV, this test requires unique disks"
                fi
                if _mount | grep -q $i; then
-                       if ! $UMOUNT_PROG $i; then
+                       if ! _unmount $i; then
                            echo "failed to unmount $i - aborting"
                            exit 1
                        fi
index fd0ef705a18c3e2af9d642b21240f5ddaa07d795..ced145dde753e15b128cd75f60ee79e8b30f1bb7 100755 (executable)
@@ -44,7 +44,7 @@ _crashtest()
                _filter_xfs_io
        $here/src/godown -f $mnt
 
-       $UMOUNT_PROG $mnt
+       _unmount $mnt
        _mount $img $mnt
 
        # We should /never/ see 0xCD in the file, because we wrote that pattern
@@ -54,7 +54,7 @@ _crashtest()
                _hexdump $file
        fi
 
-       $UMOUNT_PROG $mnt
+       _unmount $mnt
 }
 
 # Modify as appropriate.
index ca02d3092583fb759cebb58b82fd3fd3b9bee6f1..8e9456db27900317fa24379508012c039817d953 100755 (executable)
@@ -87,8 +87,9 @@ blockdev --setro $SCRATCH_DEV
 echo "mounting filesystem that needs recovery on a read-only device:"
 _try_scratch_mount 2>&1 | _filter_ro_mount | _filter_scratch
 
+# expects an error, so open code the unmount
 echo "unmounting read-only filesystem"
-_scratch_unmount 2>&1 | _filter_scratch | _filter_ending_dot
+$UMOUNT_PROG $SCRATCH_DEV 2>&1 | _filter_scratch | _filter_ending_dot
 
 #
 # This is the way out if the underlying device really is read-only.
index b561b7bc5946a2c46d973fdef7e75765c9bb21d6..ccb1e3fbbd17c24d85a9be0e31c060ce00efb335 100755 (executable)
@@ -66,7 +66,7 @@ umount_symlink_device()
        rm -f $symlink
        echo "# umount symlink to device, which is not mounted" >>$seqres.full
        ln -s $SCRATCH_DEV $symlink
-       $UMOUNT_PROG $symlink >>$seqres.full 2>&1
+       _unmount $symlink >>$seqres.full 2>&1
 }
 
 # umount a path name that is 256 bytes long, this should fail gracefully,
@@ -78,7 +78,7 @@ umount_toolong_name()
        _scratch_mount 2>&1 | tee -a $seqres.full
 
        echo "# umount a too-long name" >>$seqres.full
-       $UMOUNT_PROG $longname >>$seqres.full 2>&1
+       _unmount $longname >>$seqres.full 2>&1
        _scratch_unmount 2>&1 | tee -a $seqres.full
 }
 
@@ -93,7 +93,7 @@ lazy_umount_symlink()
        rm -f $symlink
        ln -s $SCRATCH_MNT/testdir $symlink
 
-       $UMOUNT_PROG -l $symlink >>$seqres.full 2>&1
+       _unmount -l $symlink >>$seqres.full 2>&1
        # _scratch_unmount should not be blocked
        _scratch_unmount 2>&1 | tee -a $seqres.full
 }
index 468c87ac9a9f0ac6669078f6f1f19a88353d4ffe..df17ab6c1de63771fb85eb3a6d28377e04da212a 100755 (executable)
@@ -32,7 +32,7 @@ _cleanup()
        # other tests to fail.
        while test -e /dev/mapper/$vgname-$snapname || \
              test -e /dev/mapper/$vgname-$lvname; do
-               $UMOUNT_PROG $mnt >> $seqres.full 2>&1
+               _unmount $mnt >> $seqres.full 2>&1
                $LVM_PROG lvremove -f $vgname/$snapname >>$seqres.full 2>&1
                $LVM_PROG lvremove -f $vgname/$lvname >>$seqres.full 2>&1
                $LVM_PROG vgremove -f $vgname >>$seqres.full 2>&1
index cfe6112d6b444d4fc4c448d5194f4e4846fe70a6..8fbcdce2e5a42ab0e5a698d525e19ec08287b3cf 100755 (executable)
@@ -27,7 +27,7 @@ cleanup_dmdev()
        $DMSETUP_PROG resume $lvdev >/dev/null 2>&1
        [ -n "$pid" ] && kill -9 $pid 2>/dev/null
        wait $pid
-       $UMOUNT_PROG $lvdev >/dev/null 2>&1
+       _unmount $lvdev >/dev/null 2>&1
        _dmsetup_remove $node
 }
 
@@ -69,8 +69,8 @@ for ((i=0; i<100; i++)); do
 done &
 pid=$!
 for ((i=0; i<100; i++)); do
-       $MOUNT_PROG $lvdev $SCRATCH_MNT >/dev/null 2>&1
-       $UMOUNT_PROG $lvdev >/dev/null 2>&1
+       _mount $lvdev $SCRATCH_MNT >/dev/null 2>&1
+       _unmount $lvdev >/dev/null 2>&1
 done &
 pid="$pid $!"
 
index da13715f27ac219f61eaf2f69c3de8f29967c32b..2709472f61babed01f3bfb5acee51f5195a35263 100755 (executable)
@@ -18,7 +18,7 @@ _cleanup()
 {
        cd /
        echo running > /sys/block/`_short_dev $SCSI_DEBUG_DEV`/device/state
-       $UMOUNT_PROG $SCRATCH_MNT >>$seqres.full 2>&1
+       _unmount $SCRATCH_MNT >>$seqres.full 2>&1
        $LVM_PROG vgremove -f $vgname >>$seqres.full 2>&1
        $LVM_PROG pvremove -f $SCRATCH_DEV $SCSI_DEBUG_DEV >>$seqres.full 2>&1
        $UDEV_SETTLE_PROG
index 5c8504d26c679fa3a52397aac4403379155eb2e4..8726ee61dc66ae8254df671abbf8e95f1d0033a5 100755 (executable)
@@ -36,7 +36,7 @@ mkdir $testdir
 echo "Reformat with appropriate size"
 blksz="$(_get_block_size $testdir)"
 nr_blks=10240
-umount $SCRATCH_MNT
+_scratch_unmount
 sz_bytes=$((nr_blks * 8 * blksz))
 if [ $sz_bytes -lt $((32 * 1048576)) ]; then
        sz_bytes=$((32 * 1048576))
index 17f817805389c0261188dbf4384138fa71fdc5b7..b67e817b667be545b71e9cadb8c6846b7af52ac6 100755 (executable)
@@ -35,7 +35,7 @@ mkdir $testdir
 
 echo "Reformat with appropriate size"
 blksz="$(_get_block_size $testdir)"
-umount $SCRATCH_MNT
+_scratch_unmount
 
 file_size=$((768 * 1024 * 1024))
 fs_size=$((1024 * 1024 * 1024))
index d7ac7b15d171553b1cbd4c1257f856864d4b82c9..a19ff8070fa69c1f743f9a19e118b112d88b5d8c 100755 (executable)
@@ -36,7 +36,7 @@ mkdir $testdir
 echo "Reformat with appropriate size"
 blksz="$(_get_block_size $testdir)"
 nr_blks=10240
-umount $SCRATCH_MNT
+_scratch_unmount
 sz_bytes=$((nr_blks * 8 * blksz))
 if [ $sz_bytes -lt $((32 * 1048576)) ]; then
        sz_bytes=$((32 * 1048576))
index c7c62001dbb3b22dcf830747c8a05bff89ff50f1..32343d911ceb6585762a6899d6e2b819f598f35a 100755 (executable)
@@ -37,7 +37,7 @@ mkdir $testdir
 echo "Reformat with appropriate size"
 blksz="$(_get_block_size $testdir)"
 nr_blks=10240
-umount $SCRATCH_MNT
+_scratch_unmount
 sz_bytes=$((nr_blks * 8 * blksz))
 if [ $sz_bytes -lt $((32 * 1048576)) ]; then
        sz_bytes=$((32 * 1048576))
index a6ea654b67d17988d833edfc41caf183655e715d..8e118472d8bef08fc1edec7dbd420bc3b7df1c99 100755 (executable)
@@ -12,7 +12,7 @@ _begin_fstest auto quick rw
 # Override the default cleanup function.
 _cleanup()
 {
-    umount $BINDFILE
+    _unmount $BINDFILE
     cd /
     rm -f $tmp.*
 }
index cb15e77bdbb0d0c3d9d82d2de72909e8d6fd9e0c..fef4eabb8effba3db56a7fb6d61f81c22a197d8d 100755 (executable)
@@ -61,7 +61,7 @@ md5sum $testdir/file1 | _filter_scratch
 md5sum $testdir/file2 | _filter_scratch
 
 echo "Check for damage"
-umount $SCRATCH_MNT
+_scratch_unmount
 _repair_scratch_fs >> $seqres.full
 
 # success, all done
index c56157391d3209fb1f65d3b24cfa1770fd7ac853..7273dd056d7a61c47a336e2df2ce1a06b482ab1a 100755 (executable)
@@ -16,7 +16,7 @@ _begin_fstest auto quick
 # Override the default cleanup function.
 _cleanup()
 {
-       $UMOUNT_PROG $fs_mnt
+       _unmount $fs_mnt
        _destroy_loop_device $loop_dev
        cd /
        rm -f $tmp.*
index 3bd46963a766861368d09bf91eaffed80454599d..e6334398f6a6fe0c15b32586ad9128c5a6782659 100755 (executable)
@@ -60,7 +60,7 @@ md5sum $testdir/file | _filter_scratch
 md5sum $othertestdir/otherfile | filter_otherdir
 
 echo "Unmount otherdir"
-$UMOUNT_PROG $otherdir
+_unmount $otherdir
 rm -rf $otherdir
 
 # success, all done
index acb23d17289784727f3a36244cb0d996f018108f..e56521aa01c1397b8419d7b9c19900f246989694 100755 (executable)
@@ -59,7 +59,7 @@ echo "Check output"
 md5sum $testdir/file $othertestdir/otherfile | filter_md5
 
 echo "Unmount otherdir"
-$UMOUNT_PROG $otherdir
+_unmount $otherdir
 rm -rf $otherdir
 
 # success, all done
index 45787fff06be1dc00d72890c4d64d7f633cb61ba..f9c331adb969ac4e148d5e174cfa25204c7df0d8 100755 (executable)
@@ -75,7 +75,7 @@ mount --bind $SCRATCH_MNT $SCRATCH_MNT/ro_bind_mnt
 mount -o remount,ro,bind $SCRATCH_MNT/ro_bind_mnt
 _set_encpolicy $SCRATCH_MNT/ro_bind_mnt/ro_dir |& _filter_scratch
 _get_encpolicy $SCRATCH_MNT/ro_bind_mnt/ro_dir |& _filter_scratch
-umount $SCRATCH_MNT/ro_bind_mnt
+_unmount $SCRATCH_MNT/ro_bind_mnt
 
 # success, all done
 status=0
index 32ee899f929819f0ed686f7b8cf10c7eadc783bc..905c404ccbbe69eacfca30d6edacba6ac1ea781c 100755 (executable)
@@ -28,7 +28,7 @@ _cleanup()
        xfs_freeze -u $SCRATCH_MNT 2>/dev/null
        cd /
        rm -f $tmp.*
-       $UMOUNT_PROG $SCRATCH_MNT >>$seqres.full 2>&1
+       _unmount $SCRATCH_MNT >>$seqres.full 2>&1
        $LVM_PROG vgremove -ff $vgname >>$seqres.full 2>&1
        $LVM_PROG pvremove -ff $SCRATCH_DEV >>$seqres.full 2>&1
        $UDEV_SETTLE_PROG
index e8db8acf0fe6a283b9fc44d5d4279fd3b2a36ea9..f0d2f404c3d0e9c27825a50a920b0a6f48af89a5 100755 (executable)
@@ -16,13 +16,13 @@ _begin_fstest auto quick
 # Override the default cleanup function.
 _cleanup()
 {
-       cd /
-       rm -f $tmp.*
-
        echo $$ > $cgdir/cgroup.procs
        rmdir $cgdir/$seq-cg* > /dev/null 2>&1
-       umount $SCRATCH_MNT > /dev/null 2>&1
+       _unmount $SCRATCH_MNT > /dev/null 2>&1
        _destroy_loop_device $LOOP_DEV > /dev/null 2>&1
+       cd /
+       rm -f $tmp.*
+
 }
 
 # Import common functions.
@@ -80,7 +80,7 @@ reset()
        rmdir $cgdir/$seq-cg* > /dev/null 2>&1
        $XFS_IO_PROG -fc "pwrite 0 $iosize" $SCRATCH_MNT/file \
                >> $seqres.full 2>&1
-       umount $SCRATCH_MNT || _fail "umount failed"
+       _unmount $SCRATCH_MNT || _fail "umount failed"
        _mount $LOOP_DEV $SCRATCH_MNT || _fail "mount failed"
        stat $SCRATCH_MNT/file > /dev/null
 }
index c2e03c2eabb871c9489a0a515fcf86f9a7b4de42..744d3456506fd8affa32c20e0d80d6de58d941f9 100755 (executable)
@@ -26,7 +26,7 @@ done
 # mount the base fs.  Delay the mount attempt by a small amount in the hope
 # that the mount() call will try to lock s_umount /after/ umount has already
 # taken it.
-$UMOUNT_PROG $SCRATCH_MNT &
+_unmount $SCRATCH_MNT &
 sleep 0.01s ; _scratch_mount
 wait
 
index c7c95e5608b76051be814014464f88ae2904cb03..642d47863987720bb9727bface133f4d18311feb 100755 (executable)
@@ -84,7 +84,7 @@ worker() {
                touch $mergedir/etc/access.conf
                mv $mergedir/etc/access.conf $mergedir/etc/access.conf.bak
                touch $mergedir/etc/access.conf
-               umount $mergedir
+               _unmount $mergedir
        done
        rm -f $SCRATCH_MNT/workers/$tag
 }
index e4c9990e1a9d861a4e287d2dc03a32e5963f9fe1..7473c9d337464c9718c5a64358221d34b323a3f7 100755 (executable)
@@ -18,7 +18,7 @@ _cleanup()
 {
        _kill_fsstress
        if [ -n "$loopmnt" ]; then
-               $UMOUNT_PROG $loopmnt 2>/dev/null
+               _unmount $loopmnt 2>/dev/null
                rm -r -f $loopmnt
        fi
        _dmerror_unmount
@@ -102,7 +102,7 @@ while _soak_loop_running $((25 * TIME_FACTOR)); do
 
        # Mount again to replay log after loading working table, so we have a
        # consistent fs after test.
-       $UMOUNT_PROG $loopmnt
+       _unmount $loopmnt
        is_unmounted=1
        # We must unmount dmerror at here, or whole later testing will crash.
        # So try to umount enough times, before we have no choice.
@@ -128,7 +128,7 @@ done
 # Make sure the fs image file is ok
 if [ -f "$loopimg" ]; then
        if _mount $loopimg $loopmnt -o loop; then
-               $UMOUNT_PROG $loopmnt &> /dev/null
+               _unmount $loopmnt &> /dev/null
        else
                _metadump_dev $DMERROR_DEV $seqres.scratch.final.md
                echo "final scratch mount failed"
index 28928b2fb325320aeb866383098524ff686d1587..0029df90f85705dc218776ca3e3cea8b669c90fd 100755 (executable)
@@ -17,8 +17,8 @@ _begin_fstest auto quick perms attr idmapped mount
 _cleanup()
 {
        cd /
-       $UMOUNT_PROG $SCRATCH_MNT/target-mnt 2>/dev/null
-       $UMOUNT_PROG $SCRATCH_MNT 2>/dev/null
+       _unmount $SCRATCH_MNT/target-mnt 2>/dev/null
+       _unmount $SCRATCH_MNT 2>/dev/null
        rm -r -f $tmp.*
 }
 
index 677307538a484b63ac718771da6747ba282b5379..3079a861df7457c8b486c188fe6d519e63c208de 100755 (executable)
@@ -15,9 +15,9 @@ _begin_fstest auto quick perms attr idmapped mount
 _cleanup()
 {
        cd /
-       $UMOUNT_PROG $SCRATCH_MNT/target-mnt
-       $UMOUNT_PROG $SCRATCH_MNT/ovl-merge 2>/dev/null
-       $UMOUNT_PROG $SCRATCH_MNT 2>/dev/null
+       _unmount $SCRATCH_MNT/target-mnt
+       _unmount $SCRATCH_MNT/ovl-merge 2>/dev/null
+       _unmount $SCRATCH_MNT 2>/dev/null
        rm -r -f $tmp.*
 }
 
@@ -113,7 +113,7 @@ setup_overlayfs_idmapped_lower_metacopy_on()
 
 reset_overlayfs()
 {
-       $UMOUNT_PROG $SCRATCH_MNT/ovl-merge 2>/dev/null
+       _unmount $SCRATCH_MNT/ovl-merge 2>/dev/null
        rm -rf $upper $work $merge
 }
 
index f39d47066ccc4afa642dc3e94433c518fc1146da..f452f9e9c0dc4c360bc0908755e80595523596e5 100755 (executable)
@@ -14,7 +14,7 @@ _cleanup()
 {
        cd /
        rm -r -f $tmp.*
-       [ -d "$SCSI_DEBUG_MNT" ] && $UMOUNT_PROG $SCSI_DEBUG_MNT 2>/dev/null
+       [ -d "$SCSI_DEBUG_MNT" ] && _unmount $SCSI_DEBUG_MNT 2>/dev/null
        _put_scsi_debug_dev
 }
 
index 4378e964ab85978d044c59ab40c7b67c38b9c4ee..2ecd2888d4590e9f30a8dbb55724c8f0b05552da 100755 (executable)
@@ -85,7 +85,7 @@ mkdir -p $SCRATCH_MNT/xyz
 mount --bind $dir $SCRATCH_MNT/xyz --bind
 _pwrite_byte 0x60 0 $((blksz * (nrblks + 2))) $dir/c >> $seqres.full
 $XFS_IO_PROG -c "exchangerange $SCRATCH_MNT/xyz/c" $dir/a
-umount $SCRATCH_MNT/xyz
+_unmount $SCRATCH_MNT/xyz
 
 echo Swapping a file with itself
 $XFS_IO_PROG -c "exchangerange $dir/a" $dir/a
index 062314ea01e7b5f2347addcaba1e09750e7e4c9c..6251980e33e1e33aef138135fe5f1c78e92a7ac3 100755 (executable)
@@ -12,7 +12,7 @@ _begin_fstest auto quick
 _cleanup()
 {
        cd /
-       $UMOUNT_PROG $SCSI_DEBUG_MNT >>$seqres.full 2>&1
+       _unmount $SCSI_DEBUG_MNT >>$seqres.full 2>&1
        _put_scsi_debug_dev
        rm -f $tmp.*
 }
index cd39e8b09e3906600997d8046bc904693c5c97aa..4ac5e1a3e560e197023458f99ec09a5ace47d0dd 100755 (executable)
@@ -13,7 +13,7 @@ _begin_fstest auto quick
 _cleanup()
 {
        cd /
-       $UMOUNT_PROG $SCSI_DEBUG_MNT >>$seqres.full 2>&1
+       _unmount $SCSI_DEBUG_MNT >>$seqres.full 2>&1
        _put_scsi_debug_dev
        rm -f $tmp.*
 }
index d08028c2333d1b336ca630c39327327fac73d2db..e907a009fe16073c13a895062a2dd3dd8d20ec9c 100755 (executable)
@@ -15,8 +15,8 @@ _begin_fstest auto quick rename
 # Override the default cleanup function.
 _cleanup()
 {
-       $UMOUNT_PROG $testdir1 2>/dev/null
-       $UMOUNT_PROG $testdir2 2>/dev/null
+       _unmount $testdir1 2>/dev/null
+       _unmount $testdir2 2>/dev/null
        cd /
        rm -r -f $tmp.*
 }
index 4b480b5a13b9f46630403d1a7a79a59e933b18fc..cac7045ebc6ce1ee743822dc68049620045c239f 100755 (executable)
@@ -13,7 +13,7 @@ _begin_fstest auto quick volume tempfsid
 # Override the default cleanup function.
 _cleanup()
 {
-       umount $extra_mnt &> /dev/null
+       _unmount $extra_mnt &> /dev/null
        rm -rf $extra_mnt
        _unmount_flakey
        _cleanup_flakey
index a31d8d7a4ed8c1d972cf92794a95ca412e546605..df8f6ae9b9e84bfb8f67283c81f05a31f7ba61d7 100755 (executable)
@@ -15,8 +15,8 @@ _cleanup()
        cd /
        rm -r -f $tmp.*
 
-       $UMOUNT_PROG $mnt2 &> /dev/null
-       $UMOUNT_PROG $mnt1 &> /dev/null
+       _unmount $mnt2 &> /dev/null
+       _unmount $mnt1 &> /dev/null
        [ -b "$loop_dev2" ] && losetup -d $loop_dev2
        [ -b "$loop_dev1" ] && losetup -d $loop_dev1
        [ -n "$seq" ] && rm -rf $TEST_DIR/$seq
@@ -42,7 +42,7 @@ clone_filesystem()
 
        _mount $dev1 $mnt1
        $XFS_IO_PROG -fc 'pwrite -S 0x61 0 9000' $mnt1/foo >> $seqres.full
-       $UMOUNT_PROG $mnt1
+       _unmount $mnt1
 
        # device dump of $dev1 to $dev2
        dd if=$dev1 of=$dev2 conv=fsync status=none || _fail "dd failed: $?"
index 5734f254d3d7a6d1f48feb2e6251383b1ac7bf4a..67191060681737dda1718245bcff8d7f956da53b 100755 (executable)
@@ -38,7 +38,7 @@ esac
 # Override the default cleanup function.
 _cleanup()
 {
-       $UMOUNT_PROG $loop_dev &> /dev/null
+       _unmount $loop_mnt &> /dev/null
        _destroy_loop_device $loop_dev
        if [ $status -eq 0 ]; then
                rm -rf $tmp
@@ -53,7 +53,7 @@ get_holes()
        # in-core state that will perturb the free space map on umount.  Stick
        # to established convention which requires the filesystem to be
        # unmounted while we probe the underlying file.
-       $UMOUNT_PROG $loop_mnt
+       _unmount $loop_mnt
 
        # FIEMAP only works on regular files, so call it on the backing file
        # and not the loop device like everything else
@@ -66,7 +66,7 @@ get_free_sectors()
 {
        case $FSTYP in
        ext4)
-       $UMOUNT_PROG $loop_mnt
+       _unmount $loop_mnt
        $DUMPE2FS_PROG $loop_dev  2>&1 | grep " Free blocks" | cut -d ":" -f2- | \
                tr ',' '\n' | $SED_PROG 's/^ //' | \
                $AWK_PROG -v spb=$sectors_per_block 'BEGIN{FS="-"};
@@ -80,7 +80,7 @@ get_free_sectors()
        xfs)
        agsize=`$XFS_INFO_PROG $loop_mnt | $SED_PROG -n 's/.*agsize=\(.*\) blks.*/\1/p'`
        # Convert free space (agno, block, length) to (start sector, end sector)
-       $UMOUNT_PROG $loop_mnt
+       _unmount $loop_mnt
        $XFS_DB_PROG -r -c "freesp -d" $loop_dev | $SED_PROG '/^.*from/,$d'| \
                 $AWK_PROG -v spb=$sectors_per_block -v agsize=$agsize \
                '{ print spb * ($1 * agsize + $2), spb * ($1 * agsize + $2 + $3) - 1 }'
index 098f64186e1134bde0718c6a1e760e8dbb5307be..f638e4b161a28a1d6d3fc71490f5f6c24bb82b25 100755 (executable)
@@ -22,7 +22,7 @@ _begin_fstest auto enospc quick quota prealloc
 _cleanup()
 {
        cd /
-       umount $LOOP_MNT 2>/dev/null
+       _unmount $LOOP_MNT 2>/dev/null
        _scratch_unmount 2>/dev/null
        rm -f $tmp.*
 }
@@ -168,13 +168,13 @@ LOOP_MNT=$SCRATCH_MNT/$seq.mnt
 $MKFS_XFS_PROG -d "file=1,name=$LOOP_FILE,size=10g" >> $seqres.full 2>&1
 
 mkdir -p $LOOP_MNT
-mount -t xfs -o loop,uquota,gquota $LOOP_FILE $LOOP_MNT || \
+_mount -o uquota,gquota $LOOP_FILE $LOOP_MNT || \
        _fail "Failed to mount loop fs."
 
 _test_enospc $LOOP_MNT
 _test_edquot $LOOP_MNT
 
-umount $LOOP_MNT
+_unmount $LOOP_MNT
 
 echo $orig_sp_time > /proc/sys/fs/xfs/speculative_prealloc_lifetime
 
index 28f1fad08b8c965a882f1e6937c858232743138a..e4b17c5e7f2fc6f593378b0302f0e1fa5c160e28 100755 (executable)
@@ -21,9 +21,9 @@ _cleanup()
 {
        cd /
        _scratch_unmount 2>/dev/null
-       umount $imgs.loop 2>/dev/null
+       _unmount $imgs.loop 2>/dev/null
+       _unmount $imgs.source_dir 2>/dev/null
        [ -d $imgs.loop ] && rmdir $imgs.loop
-       umount $imgs.source_dir 2>/dev/null
        [ -d $imgs.source_dir ] && rm -rf $imgs.source_dir
        rm -f $imgs.* $tmp.* /var/tmp/xfs_copy.log.*
 }
@@ -65,10 +65,10 @@ _verify_copy()
        rmdir $target_dir 2>/dev/null
        mkdir $target_dir
 
-       mount -t xfs -o loop $target $target_dir 2>/dev/null
+       _mount -t xfs -o loop $target $target_dir 2>/dev/null
        if [ $? -ne 0 ]; then
                echo retrying mount with nouuid option >>$seqres.full
-               mount -t xfs -o loop -o nouuid $target $target_dir
+               _mount -t xfs -o loop -o nouuid $target $target_dir
                if [ $? -ne 0 ]; then
                        echo mount failed - evil!
                        return
@@ -87,19 +87,19 @@ _verify_copy()
 
        echo comparing new image geometry to old
        $XFS_INFO_PROG $source_dir \
-               | _filter_copy $source $source_dir '/dev/loop.' '#' \
+               | _filter_copy $source $source_dir '/dev/loop[0-9]\+' '#' \
                | tr -s ' ' \
                > $tmp.geometry1
        $XFS_INFO_PROG $target_dir \
-               | _filter_copy $target $target_dir '/dev/loop.' '#' \
+               | _filter_copy $target $target_dir '/dev/loop[0-9]\+' '#' \
                | tr -s ' ' \
                > $tmp.geometry2
        [ -s $tmp.geometry1 ] || echo no geometry output
        diff -u $tmp.geometry1 $tmp.geometry2
 
        echo unmounting and removing new image
-       umount $source_dir
-       umount $target_dir > /dev/null 2>&1
+       _unmount $source_dir
+       _unmount $target_dir > /dev/null 2>&1
        rm -f $target
 }
 
@@ -134,10 +134,10 @@ ${MKFS_XFS_PROG} -dfile,name=$imgs.source,size=100g \
 rmdir $imgs.source_dir 2>/dev/null
 mkdir $imgs.source_dir
 
-mount -t xfs -o loop $imgs.source $imgs.source_dir
+_mount -t xfs -o loop $imgs.source $imgs.source_dir
 loop2=`mount | grep $imgs.source | grep -o -e 'loop=.*[^),]' | grep -o -e '/.*$'`
 cp -a $here $imgs.source_dir
-mount -t xfs -o remount,ro $imgs.source $imgs.source_dir
+_mount -t xfs -o remount,ro $imgs.source $imgs.source_dir
 $XFS_COPY_PROG $imgs.source $imgs.image | _filter_copy '#' $imgs.image '#' '#'
 _verify_copy $imgs.image $imgs.source $imgs.source_dir
 
index 278f0ade694d225cec2dbbd8c0c53ce172cf05b6..6a03c81114edeb72ed3849b4cfad4bc55f0ecea3 100755 (executable)
@@ -72,7 +72,7 @@ $XFS_IO_PROG -ft \
        -c "falloc 1023m 2g" \
        $LOOP_MNT/foo >> $seqres.full
 
-umount $LOOP_MNT
+_unmount $LOOP_MNT
 _check_xfs_filesystem $LOOP_DEV none none
 
 # success, all done
index 834c99a00201532c2cd178816e0b54112495b0e9..6b325e05f6433a6b364e2bea338bb3ff9a5fd438 100755 (executable)
@@ -16,7 +16,7 @@ _cleanup()
 {
        cd /
        rm -f $tmp.*
-       $UMOUNT_PROG $LOOP_MNT 2>/dev/null
+       _unmount $LOOP_MNT 2>/dev/null
        [ -n "$LOOP_DEV" ] && _destroy_loop_device $LOOP_DEV 2>/dev/null
        # try to keep the image file if test fails
        [ $status -eq 0 ] && rm -f $LOOP_IMG
@@ -75,13 +75,13 @@ _grow_loop()
        $XFS_IO_PROG -c "pwrite $new_size $bsize" $LOOP_IMG | _filter_io
        LOOP_DEV=`_create_loop_device $LOOP_IMG`
        echo "*** mount loop filesystem"
-       $MOUNT_PROG -t xfs $LOOP_DEV $LOOP_MNT
+       _mount -t xfs $LOOP_DEV $LOOP_MNT
 
        echo "*** grow loop filesystem"
        $XFS_GROWFS_PROG $LOOP_MNT 2>&1 |  _filter_growfs 2>&1
 
        echo "*** unmount"
-       $UMOUNT_PROG -d $LOOP_MNT && LOOP_DEV=
+       _unmount $LOOP_MNT
 
        # Large grows takes forever to check..
        if [ "$check" -gt "0" ]
index 9e6798f999b3561f0d792a1598e557dc7b4d080f..c42c9b119a76ac36bc6369b5ff9825bf95a16e32 100755 (executable)
@@ -14,7 +14,7 @@ _begin_fstest auto quick fuzzers
 _cleanup()
 {
        cd /
-       $UMOUNT_PROG $mntpt > /dev/null 2>&1
+       _unmount $mntpt > /dev/null 2>&1
        _destroy_loop_device $loopdev > /dev/null 2>&1
        rm -r -f $tmp.*
 }
@@ -90,7 +90,7 @@ cat $tmp.log >> $seqres.full
 cat $tmp.log | _filter_test_dir
 
 # Corrupt the entries
-$UMOUNT_PROG $mntpt
+_unmount $mntpt
 _destroy_loop_device $loopdev
 cp $imgfile $imgfile.old
 sed -b \
@@ -121,7 +121,7 @@ fi
 echo "does repair complain?" >> $seqres.full
 
 # Does repair complain about this?
-$UMOUNT_PROG $mntpt
+_unmount $mntpt
 $XFS_REPAIR_PROG -n $loopdev >> $seqres.full 2>&1
 res=$?
 test $res -eq 1 || \
index f1b2405e7bff11fe68900d8c392cad34f6bfd5a4..f2187109b4876cf93bd3dde0cf620e7ef04359bc 100755 (executable)
@@ -22,7 +22,7 @@ loop_symlink=$TEST_DIR/loop_symlink.$$
 # Override the default cleanup function.
 _cleanup()
 {
-    $UMOUNT_PROG $mntdir
+    _unmount $mntdir
     [ -n "$loop_dev" ] && _destroy_loop_device $loop_dev
     rmdir $mntdir
     rm -f $loop_symlink
@@ -73,7 +73,7 @@ echo "=== xfs_growfs - check device symlink ==="
 $XFS_GROWFS_PROG -D 12288 $loop_symlink > /dev/null
 
 echo "=== unmount ==="
-$UMOUNT_PROG $mntdir || _fail "!!! failed to unmount"
+_unmount $mntdir || _fail "!!! failed to unmount"
 
 echo "=== mount device symlink ==="
 $MOUNT_PROG $loop_symlink $mntdir || _fail "!!! failed to loopback mount"
index 88f02585e7f667c67a12467c1e0208b4241bff98..6f82e0cda1c17a941b4c9a77784ee5a1a9e40347 100755 (executable)
@@ -87,7 +87,7 @@ _do_eas()
                _create_eas $2 $3
        fi
        echo ""
-       cd /; $UMOUNT_PROG $SCRATCH_MNT
+       cd /; _unmount $SCRATCH_MNT
        _print_inode
 }
 
@@ -99,7 +99,7 @@ _do_dirents()
        echo ""
        _scratch_mount
        _create_dirents $1 $2
-       cd /; $UMOUNT_PROG $SCRATCH_MNT
+       cd /; _unmount $SCRATCH_MNT
        _print_inode
 }
 
index 680239b4ef788d07792ac89f8ee373df249e1aab..6b8b2eb2210d8606086d329661fed578bf1435b6 100755 (executable)
@@ -12,6 +12,12 @@ _begin_fstest log metadata auto quick
 # Import common functions.
 . ./common/filter
 
+_cleanup()
+{
+       _unmount $LOOP_MNT > /dev/null 2>&1
+       cd /
+       rm -f $tmp.*
+}
 
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
@@ -50,9 +56,9 @@ _do_mkfs()
                echo -n "fssize=${i}g "
                $MKFS_XFS_PROG -f -b size=4096 -l version=2 \
                        -d name=$LOOP_DEV,size=${i}g $loop_mkfs_opts |grep log
-               mount -o loop -t xfs $LOOP_DEV $LOOP_MNT
+               _mount -o loop -t xfs $LOOP_DEV $LOOP_MNT
                echo "test write" > $LOOP_MNT/test
-               umount $LOOP_MNT > /dev/null 2>&1
+               _unmount $LOOP_MNT > /dev/null 2>&1
        done
 }
 # make large holey file
index 41caaf738267d43587e099caba635e4f6b91f389..b2eb34490ee1b58d077acb966bf9874d3d8dfdfb 100755 (executable)
@@ -29,9 +29,9 @@ _do_mkfs()
                echo -n "fssize=${i}g "
                $MKFS_XFS_PROG -f -b size=4096 -l version=2 \
                        -d name=$LOOP_DEV,size=${i}g |grep log
-               mount -o loop -t xfs $LOOP_DEV $LOOP_MNT
+               _mount -o loop -t xfs $LOOP_DEV $LOOP_MNT
                echo "test write" > $LOOP_MNT/test
-               umount $LOOP_MNT > /dev/null 2>&1
+               _unmount $LOOP_MNT > /dev/null 2>&1
 
                # punch out the previous blocks so that we keep the amount of
                # disk space the test requires down to a minimum.
index f8846be6e197aa52a93ffbe1a11440e01cba6c44..4e3473ebcef69c0c4e2d0d1cc6b201c4fda4fcb5 100755 (executable)
@@ -13,9 +13,10 @@ _begin_fstest auto quick rw prealloc metadata
 _cleanup()
 {
        cd /
-       umount $LOOP_MNT 2>/dev/null
+       _unmount $LOOP_MNT 2>/dev/null
        rm -f $LOOP_DEV
        rmdir $LOOP_MNT
+       rm -f $tmp.*
 }
 
 # Import common functions.
@@ -54,13 +55,13 @@ _test_loop()
                | _filter_mkfs 2>/dev/null
 
        echo "*** mount loop filesystem"
-       mount -t xfs -o loop $LOOP_DEV $LOOP_MNT
+       _mount -t xfs -o loop $LOOP_DEV $LOOP_MNT
 
        echo "*** preallocate large file"
        $XFS_IO_PROG -f -c "resvsp 0 $fsize" $LOOP_MNT/foo | _filter_io
 
        echo "*** unmount loop filesystem"
-       umount $LOOP_MNT > /dev/null 2>&1
+       _unmount $LOOP_MNT > /dev/null 2>&1
 
        echo "*** check loop filesystem"
         _check_xfs_filesystem $LOOP_DEV none none
index cf0f2883c4f373e3dad7969f4eb05c45c309a53d..d234f212d49b8344611d9c98ad25feca5964c7aa 100755 (executable)
@@ -13,8 +13,8 @@ _begin_fstest growfs auto quick
 # Override the default cleanup function.
 _cleanup()
 {
-    $UMOUNT_PROG $tmpdir
-    $UMOUNT_PROG $tmpbind
+    _unmount $tmpdir
+    _unmount $tmpbind
     rmdir $tmpdir
     rm -f $tmpsymlink
     rmdir $tmpbind
index 75c183c07a9fcee072f2daa95cf61cd4395f94b3..52d9b94b4dd903a5cb7e4e78740e5ce0a3fa5176 100755 (executable)
@@ -22,7 +22,7 @@ _register_cleanup "_cleanup" BUS
 _cleanup()
 {
        cd /
-       test -n "$loop_mount" && $UMOUNT_PROG $loop_mount > /dev/null 2>&1
+       test -n "$loop_mount" && _unmount $loop_mount > /dev/null 2>&1
        test -n "$loop_dev" && _destroy_loop_device $loop_dev
        rm -rf $tmp.*
 }
index 5585a9c8e76703adf9a37e35fd8da04406aa5dd8..5895e6e2df2921dffeb785e11eba63788cd35657 100755 (executable)
@@ -14,7 +14,7 @@ _cleanup()
 {
        cd /
        rm -f $tmp.*
-       $UMOUNT_PROG $LOOP_MNT 2>/dev/null
+       _unmount $LOOP_MNT 2>/dev/null
        if [ -n "$LOOP_DEV" ];then
                _destroy_loop_device $LOOP_DEV 2>/dev/null
        fi
@@ -89,7 +89,7 @@ get_mount_info()
 
 force_unmount()
 {
-       $UMOUNT_PROG $LOOP_MNT >/dev/null 2>&1
+       _unmount $LOOP_MNT >/dev/null 2>&1
 }
 
 # _do_test <mount options> <should be mounted?> [<key string> <key should be found?>]
index bd694453d5409f61e556731f437d84a100633d3e..b7eef51c7fddbebfc8d7c79034b9773b3454bcdb 100755 (executable)
@@ -15,7 +15,7 @@ _cleanup()
        _cleanup_dump
        cd /
        rm -r -f $tmp.*
-       $UMOUNT_PROG $TEST_DIR/dest.$seq 2> /dev/null
+       _unmount $TEST_DIR/dest.$seq 2> /dev/null
        rmdir $TEST_DIR/src.$seq 2> /dev/null
        rmdir $TEST_DIR/dest.$seq 2> /dev/null
 }
index 02de601d6fa3afece010422d7e9d0739f5c9f952..f958bddd8f171c7d0410235b463661f4568e42fc 100755 (executable)
@@ -14,7 +14,7 @@ _begin_fstest auto quick growfs
 _cleanup()
 {
        local dev
-       $UMOUNT_PROG $LOOP_MNT 2>/dev/null
+       _unmount $LOOP_MNT 2>/dev/null
        dev=$(losetup -j testfile | cut -d: -f1)
        losetup -d $dev 2>/dev/null
        rm -rf $LOOP_IMG $LOOP_MNT
index 1947afec7619adb983c88953b49ebe11ca9085da..6ba3d87bf6e9f866004e6f0938f3c825ad2165a4 100755 (executable)
@@ -14,7 +14,7 @@ _cleanup()
 {
        cd /
        rm -f $tmp.*
-       $UMOUNT_PROG $LOOP_MNT 2>/dev/null
+       _unmount $LOOP_MNT 2>/dev/null
        if [ -n "$LOOP_DEV" ];then
                _destroy_loop_device $LOOP_DEV 2>/dev/null
        fi
@@ -90,7 +90,7 @@ get_mount_info()
 
 force_unmount()
 {
-       $UMOUNT_PROG $LOOP_MNT >/dev/null 2>&1
+       _unmount $LOOP_MNT >/dev/null 2>&1
 }
 
 # _do_test <mount options> <should be mounted?> [<key string> <key should be found?>]