@@ -12,6 +12,15 @@
. ./common/preamble
_begin_fstest auto metadata quick
+_cleanup()
+{
+ [ -n "$link_pids" ] && kill $link_pids
+ [ -n "$open_pid" ] && kill $open_pid
+ wait
+ cd /
+ rm -f $tmp.*
+}
+
# Import common functions.
. ./common/filter
@@ -57,9 +66,6 @@ done &
sleep 5
kill $! >/dev/null 2>&1
-kill $open_pid $link_pids >/dev/null 2>&1
-wait $open_pid $link_pids
-
# all done, no oops/hang expected, _check_filesystems checks SCRATCH_DEV after test
status=0
exit
@@ -66,22 +66,22 @@ _scratch_mount
# for each operation and runs for $LOOP_TIME seconds, and check filesystem
# consistency after each iteration
for i in `seq 1 $LOOP_CNT`; do
- rm -f $stop
+ touch $stop
for j in `seq 1 $PROC_CNT`; do
- while [ ! -e $stop ]; do
+ while [ -e $stop ]; do
do_write
done &
- while [ ! -e $stop ]; do
+ while [ -e $stop ]; do
do_append
done &
- while [ ! -e $stop ]; do
+ while [ -e $stop ]; do
do_writeback
done &
done
sleep $LOOP_TIME
- touch $stop
+ rm -f $stop
wait
_scratch_unmount
@@ -52,8 +52,6 @@ nr_hotplug_cpus="${#hotplug_cpus[@]}"
test "$nr_hotplug_cpus" -gt 0 || _notrun "CPU hotplugging not supported"
stress_dir="$TEST_DIR/$seq"
-rm -r -f "$stress_dir"
-mkdir -p "$stress_dir"
echo "Silence is golden."
@@ -79,12 +77,14 @@ fsstress_args+=(--duration="$((SOAK_DURATION / 10))")
nr_ops=$((2500 * TIME_FACTOR))
fsstress_args+=(-n $nr_ops)
for ((i = 0; i < 10; i++)); do
- _run_fsstress_bg -w "${fsstress_args[@]}"
- _wait_for_fsstress
+ rm -rf "$stress_dir"
+ mkdir -p "$stress_dir"
+ _run_fsstress "${fsstress_args[@]}"
_test_cycle_mount
done
rm -f $sentinel_file
+wait
# success, all done
status=0
@@ -120,6 +120,7 @@ _kill_fsstress
# clean out the competing fsstress allocations, then everything else
rm -rf $SCRATCH_MNT/fsstress
rm -rf $SCRATCH_MNT/dir*
+wait
_scratch_unmount
@@ -193,6 +193,7 @@ wait_for_errortag &
$XFS_IO_PROG -c "pwrite -S 0x56 $((2 * blksz)) $((2 * blksz))" \
-c 'fsync' $SCRATCH_MNT/file >> $seqres.full
rm -f $sentryfile
+wait
cat "$tracefile" >> $seqres.full
grep -q iomap_invalid "$tracefile"