]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
btrfs: remove stop file early at _btrfs_stress_subvolume
authorFilipe Manana <fdmanana@suse.com>
Wed, 27 Mar 2024 17:11:43 +0000 (17:11 +0000)
committerAnand Jain <anand.jain@oracle.com>
Wed, 3 Apr 2024 07:08:49 +0000 (15:08 +0800)
Instead of having every test case that uses _btrfs_stress_subvolume()
removing the stop file before calling that function, do the file
remove at _btrfs_stress_subvolume(). There's no point in doing it in
every single test case.

Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Anand Jain <anand.jain@oracle.com>
common/btrfs
tests/btrfs/060
tests/btrfs/065
tests/btrfs/066
tests/btrfs/067
tests/btrfs/068

index 0f79b2510ff1716aae52964d3c514f90750a2bd4..2c086227d8e0a2c1cf534c84e318bef9bb718934 100644 (file)
@@ -341,6 +341,7 @@ _btrfs_stress_subvolume()
        local subvol_mnt=$4
        local stop_file=$5
 
+       rm -f $stop_file
        mkdir -p $subvol_mnt
        while [ ! -e $stop_file ]; do
                $BTRFS_UTIL_PROG subvolume create $btrfs_mnt/$subvol_name
index 87823abad17859d0384f73c8c0e9a2cd52f07063..53cbd3a0d772adaee7e13148176741c1a314dbf6 100755 (executable)
@@ -46,8 +46,6 @@ run_test()
        balance_pid=$!
        echo "$balance_pid" >>$seqres.full
 
-       # make sure the stop sign is not there
-       rm -f $stop_file
        echo -n "Start subvolume worker: " >>$seqres.full
        _btrfs_stress_subvolume $SCRATCH_DEV $SCRATCH_MNT subvol_$$ $subvol_mnt $stop_file >/dev/null 2>&1 &
        subvol_pid=$!
index ddc286161f418726b914f0ed1fd21aeb07b26e97..f9e43cdc01884f49c70dd634fdcce43ed923a43d 100755 (executable)
@@ -49,8 +49,6 @@ run_test()
        $FSSTRESS_PROG $args >>$seqres.full &
        fsstress_pid=$!
 
-       # make sure the stop sign is not there
-       rm -f $stop_file
        echo -n "Start subvolume worker: " >>$seqres.full
        _btrfs_stress_subvolume $SCRATCH_DEV $SCRATCH_MNT subvol_$$ $subvol_mnt $stop_file >/dev/null 2>&1 &
        subvol_pid=$!
index c74886027586e6d6aab728a8d1eede793ef29177..b6f904ac509d39c1e8694b0a3fde20d40d1b177a 100755 (executable)
@@ -41,8 +41,6 @@ run_test()
        $FSSTRESS_PROG $args >>$seqres.full &
        fsstress_pid=$!
 
-       # make sure the stop sign is not there
-       rm -f $stop_file
        echo -n "Start subvolume worker: " >>$seqres.full
        _btrfs_stress_subvolume $SCRATCH_DEV $SCRATCH_MNT subvol_$$ $subvol_mnt $stop_file >/dev/null 2>&1 &
        subvol_pid=$!
index ebbec1beecb1d74cb48acee751effa42b22f14b7..7be09d52f14de3ed893b491cecfae4a2e7770502 100755 (executable)
@@ -42,8 +42,6 @@ run_test()
        $FSSTRESS_PROG $args >>$seqres.full &
        fsstress_pid=$!
 
-       # make sure the stop sign is not there
-       rm -f $stop_file
        echo -n "Start subvolume worker: " >>$seqres.full
        _btrfs_stress_subvolume $SCRATCH_DEV $SCRATCH_MNT subvol_$$ $subvol_mnt $stop_file >/dev/null 2>&1 &
        subvol_pid=$!
index 5f41fb7428f1554f57767827f07721a665faa504..19e3701023bf7ac70c745ae8b79c9cf228a5afe3 100755 (executable)
@@ -42,8 +42,6 @@ run_test()
        $FSSTRESS_PROG $args >>$seqres.full &
        fsstress_pid=$!
 
-       # make sure the stop sign is not there
-       rm -f $stop_file
        echo -n "Start subvolume worker: " >>$seqres.full
        _btrfs_stress_subvolume $SCRATCH_DEV $SCRATCH_MNT subvol_$$ $subvol_mnt $stop_file >/dev/null 2>&1 &
        subvol_pid=$!