@@ -362,11 +362,13 @@ _btrfs_kill_stress_subvolume_pid()
{
local subvol_pid=$1
local stop_file=$2
+ local subvol_mnt=$3
touch $stop_file
# Ignore if process already died.
wait $subvol_pid &> /dev/null
rm -f $stop_file
+ $UMOUNT_PROG $subvol_mnt &> /dev/null
}
# stress btrfs by running scrub in a loop
@@ -14,8 +14,9 @@ _cleanup()
{
cd /
rm -rf $tmp.*
- if [ ! -z "$stop_file" ] && [ ! -z "$subvol_pid" ]; then
- _btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file
+ if [ ! -z "$stop_file" ] && [ ! -z "$subvol_pid" ] && \
+ [ ! -z "$subvol_mnt" ]; then
+ _btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file $subvol_mnt
fi
if [ ! -z "$balance_pid" ]; then
_btrfs_kill_stress_balance_pid $balance_pid
@@ -34,11 +35,11 @@ _require_scratch_dev_pool 4
_btrfs_get_profile_configs
stop_file=$TEST_DIR/$seq.stop.$$
+subvol_mnt=$TEST_DIR/$seq.mnt
run_test()
{
local mkfs_opts=$1
- local subvol_mnt=$TEST_DIR/$seq.mnt
echo "Test $mkfs_opts" >>$seqres.full
@@ -69,7 +70,7 @@ run_test()
wait $fsstress_pid
unset fsstress_pid
- _btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file
+ _btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file $subvol_mnt
unset subvol_pid
_btrfs_kill_stress_balance_pid $balance_pid
unset balance_pid
@@ -14,8 +14,9 @@ _cleanup()
{
cd /
rm -rf $tmp.*
- if [ ! -z "$stop_file" ] && [ ! -z "$subvol_pid" ]; then
- _btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file
+ if [ ! -z "$stop_file" ] && [ ! -z "$subvol_pid" ] && \
+ [ ! -z "$subvol_mnt" ]; then
+ _btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file $subvol_mnt
fi
if [ ! -z "$replace_pid" ]; then
_btrfs_kill_stress_replace_pid $replace_pid
@@ -35,12 +36,12 @@ _require_scratch_dev_pool_equal_size
_btrfs_get_profile_configs replace
stop_file=$TEST_DIR/$seq.stop.$$
+subvol_mnt=$TEST_DIR/$seq.mnt
run_test()
{
local mkfs_opts=$1
local saved_scratch_dev_pool=$SCRATCH_DEV_POOL
- local subvol_mnt=$TEST_DIR/$seq.mnt
echo "Test $mkfs_opts" >>$seqres.full
@@ -77,7 +78,7 @@ run_test()
wait $fsstress_pid
unset fsstress_pid
- _btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file
+ _btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file $subvol_mnt
unset subvol_pid
_btrfs_kill_stress_replace_pid $replace_pid
unset replace_pid
@@ -14,8 +14,9 @@ _cleanup()
{
cd /
rm -rf $tmp.*
- if [ ! -z "$stop_file" ] && [ ! -z "$subvol_pid" ]; then
- _btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file
+ if [ ! -z "$stop_file" ] && [ ! -z "$subvol_pid" ] && \
+ [ ! -z "$subvol_mnt" ]; then
+ _btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file $subvol_mnt
fi
if [ ! -z "$scrub_pid" ]; then
_btrfs_kill_stress_scrub_pid $scrub_pid
@@ -34,11 +35,11 @@ _require_scratch_dev_pool 4
_btrfs_get_profile_configs
stop_file=$TEST_DIR/$seq.stop.$$
+subvol_mnt=$TEST_DIR/$seq.mnt
run_test()
{
local mkfs_opts=$1
- local subvol_mnt=$TEST_DIR/$seq.mnt
echo "Test $mkfs_opts" >>$seqres.full
@@ -69,7 +70,7 @@ run_test()
wait $fsstress_pid
unset fsstress_pid
- _btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file
+ _btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file $subvol_mnt
unset subvol_pid
_btrfs_kill_stress_scrub_pid $scrub_pid
unset scrub_pid
@@ -14,8 +14,9 @@ _cleanup()
{
cd /
rm -rf $tmp.*
- if [ ! -z "$stop_file" ] && [ ! -z "$subvol_pid" ]; then
- _btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file
+ if [ ! -z "$stop_file" ] && [ ! -z "$subvol_pid" ] && \
+ [ ! -z "$subvol_mnt" ]; then
+ _btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file $subvol_mnt
fi
if [ ! -z "$defrag_pid" ]; then
_btrfs_kill_stress_defrag_pid $defrag_pid
@@ -34,12 +35,12 @@ _require_scratch_dev_pool 4
_btrfs_get_profile_configs
stop_file=$TEST_DIR/$seq.stop.$$
+subvol_mnt=$TEST_DIR/$seq.mnt
run_test()
{
local mkfs_opts=$1
local with_compress=$2
- local subvol_mnt=$TEST_DIR/$seq.mnt
echo "Test $mkfs_opts with $with_compress" >>$seqres.full
@@ -70,7 +71,7 @@ run_test()
wait $fsstress_pid
unset fsstress_pid
- _btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file
+ _btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file $subvol_mnt
unset subvol_pid
_btrfs_kill_stress_defrag_pid $defrag_pid
unset defrag_pid
@@ -15,8 +15,9 @@ _cleanup()
{
cd /
rm -rf $tmp.*
- if [ ! -z "$stop_file" ] && [ ! -z "$subvol_pid" ]; then
- _btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file
+ if [ ! -z "$stop_file" ] && [ ! -z "$subvol_pid" ] && \
+ [ ! -z "$subvol_mnt" ]; then
+ _btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file $subvol_mnt
fi
if [ ! -z "$remount_pid" ]; then
_btrfs_kill_stress_remount_compress_pid $remount_pid $SCRATCH_MNT
@@ -35,11 +36,11 @@ _require_scratch_dev_pool 4
_btrfs_get_profile_configs
stop_file=$TEST_DIR/$seq.stop.$$
+subvol_mnt=$TEST_DIR/$seq.mnt
run_test()
{
local mkfs_opts=$1
- local subvol_mnt=$TEST_DIR/$seq.mnt
echo "Test $mkfs_opts with $with_compress" >>$seqres.full
@@ -70,7 +71,7 @@ run_test()
wait $fsstress_pid
unset fsstress_pid
- _btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file
+ _btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file $subvol_mnt
unset subvol_pid
_btrfs_kill_stress_remount_compress_pid $remount_pid $SCRATCH_MNT
unset remount_pid