done
}
+# Kill a background process running _btrfs_stress_subvolume()
+_btrfs_kill_stress_subvolume_pid()
+{
+ local subvol_pid=$1
+ local stop_file=$2
+
+ touch $stop_file
+ # Ignore if process already died.
+ wait $subvol_pid &> /dev/null
+ rm -f $stop_file
+}
+
# stress btrfs by running scrub in a loop
_btrfs_stress_scrub()
{
echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full
wait $fsstress_pid
- touch $stop_file
- wait $subvol_pid
+ _btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file
_btrfs_kill_stress_balance_pid $balance_pid
echo "Scrub the filesystem" >>$seqres.full
echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full
wait $fsstress_pid
- touch $stop_file
- wait $subvol_pid
+ _btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file
_btrfs_kill_stress_replace_pid $replace_pid
echo "Scrub the filesystem" >>$seqres.full
echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full
wait $fsstress_pid
- touch $stop_file
- wait $subvol_pid
+ _btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file
_btrfs_kill_stress_scrub_pid $scrub_pid
echo "Scrub the filesystem" >>$seqres.full
echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full
wait $fsstress_pid
- touch $stop_file
- wait $subvol_pid
+ _btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file
_btrfs_kill_stress_defrag_pid $defrag_pid
echo "Scrub the filesystem" >>$seqres.full
echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full
wait $fsstress_pid
- touch $stop_file
- wait $subvol_pid
+ _btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file
_btrfs_kill_stress_remount_compress_pid $remount_pid $SCRATCH_MNT
echo "Scrub the filesystem" >>$seqres.full