fstests: use _scratch_shutdown instead of calling src/godown
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 20 May 2019 22:31:10 +0000 (15:31 -0700)
committerEryu Guan <guaneryu@gmail.com>
Fri, 24 May 2019 09:18:35 +0000 (17:18 +0800)
Overlayfs introduces some complexity with regards to what path we have
to use to shut down the scratch filesystem: it's SCRATCH_MNT for regular
filesystems, but it's OVL_BASE_SCRATCH_MNT (i.e. the lower mount of the
overlay) if overlayfs is enabled.  The helper works through all that, so
we might as well use it.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/generic/050
tests/xfs/051
tests/xfs/079
tests/xfs/121
tests/xfs/181

index 9a32716512936cac405ca31ba1a80217123f3d3d..91632d2d0010d9fc3714016f7b7a2c904c64366e 100755 (executable)
@@ -92,7 +92,7 @@ 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}
 
 echo "going down:"
-src/godown -f $SCRATCH_MNT
+_scratch_shutdown -f
 
 echo "unmounting shutdown filesystem:"
 _scratch_unmount 2>&1 | _filter_scratch
index bcc824f823aa7ebb5b8127018c05b49a8e9d2518..105fa9ff48bfb3174de1a21c4f36cb54ba602276 100755 (executable)
@@ -47,7 +47,7 @@ _scratch_mount
 # recovery.
 $FSSTRESS_PROG -n 9999 -p 2 -w -d $SCRATCH_MNT > /dev/null 2>&1 &
 sleep 5
-src/godown -f $SCRATCH_MNT
+_scratch_shutdown -f
 $KILLALL_PROG -q $FSSTRESS_PROG
 wait
 _scratch_unmount
index bf965a7f75e8acf1d8ebb84e95c1933b01ae1297..67250495336eab98898387357194e9e6df77717e 100755 (executable)
@@ -56,7 +56,7 @@ _scratch_mount "-o logbsize=32k"
 # Run a workload to dirty the log, wait a bit and shutdown the fs.
 $FSSTRESS_PROG -d $SCRATCH_MNT -p 4 -n 99999999 >> $seqres.full 2>&1 &
 sleep 10
-./src/godown -f $SCRATCH_MNT
+_scratch_shutdown -f
 wait
 
 # Remount with a different log buffer size. Going from 32k to 64k increases the
index d82a367f89891071b5f87ee114bd921f01395978..2e3914b77e2524f17b8a54b2bee47c2c3f7701f4 100755 (executable)
@@ -52,7 +52,7 @@ src/multi_open_unlink -f $SCRATCH_MNT/test_file -n $num_files -s $delay &
 sleep 3
 
 echo "godown"
-src/godown -v -f $SCRATCH_MNT >> $seqres.full
+_scratch_shutdown -v -f >> $seqres.full
 
 # time for multi_open_unlink to exit out after its delay
 # so we have no references and can unmount
@@ -69,7 +69,7 @@ _try_scratch_mount $mnt >>$seqres.full 2>&1 \
     || _fail "mount failed: $mnt $MOUNT_OPTIONS"
 
 echo "godown"
-src/godown -v -f $SCRATCH_MNT >> $seqres.full
+_scratch_shutdown -v -f >> $seqres.full
 
 echo "unmount"
 _scratch_unmount
index 882a974b5d09724dcb014d1367e5d935922c952a..dba69a7024764b40253bc7870692c863617dd97c 100755 (executable)
@@ -65,7 +65,7 @@ pid=$!
 sleep 10
 
 echo "godown"
-src/godown -v -f $SCRATCH_MNT >> $seqres.full
+_scratch_shutdown -v -f >> $seqres.full
 
 # kill the multi_open_unlink
 kill $pid 2>/dev/null
@@ -83,7 +83,7 @@ _scratch_mount $mnt >>$seqres.full 2>&1 \
     || _fail "mount failed: $mnt $MOUNT_OPTIONS"
 
 echo "godown"
-src/godown -v -f $SCRATCH_MNT >> $seqres.full
+_scratch_shutdown -v -f >> $seqres.full
 
 echo "unmount"
 _scratch_unmount