echo "+++ stressing filesystem"
mkdir -p $SCRATCH_MNT/data
[ "$FSTYP" == "xfs" ] && _xfs_force_bdev data $SCRATCH_MNT/data
- $FSSTRESS_PROG "${fsstress_args[@]}" -d $SCRATCH_MNT/data
+ _run_fsstress "${fsstress_args[@]}" -d $SCRATCH_MNT/data
if [ "$FSTYP" = "xfs" ]; then
if _xfs_has_feature "$SCRATCH_MNT" realtime; then
mkdir -p $SCRATCH_MNT/rt
_xfs_force_bdev realtime $SCRATCH_MNT/rt
- $FSSTRESS_PROG "${fsstress_args[@]}" -d $SCRATCH_MNT/rt
+ _run_fsstress "${fsstress_args[@]}" -d $SCRATCH_MNT/rt
else
echo "+++ xfs realtime not configured"
fi
res=$?
echo "$mode fsx exits with $res at $(date)" >> $seqres.full
if [ "$res" -ne 0 ] && [ "$res" -ne 124 ]; then
- # Stop if fsstress returns error. Mask off
+ # Stop if fsx returns error. Mask off
# the magic code 124 because that is how the
# timeout(1) program communicates that we ran
# out of time.
# As of March 2022, 2 million fsstress ops should be enough to keep
# any filesystem busy for a couple of hours.
- local args=$(_scale_fsstress_args -p 4 -d $SCRATCH_MNT -n 2000000 "${focus[@]}" $FSSTRESS_AVOID)
+ local args=$(_scale_fsstress_args -p 4 -d $SCRATCH_MNT -n 2000000 "${focus[@]}")
echo "Running $FSSTRESS_PROG $args" >> $seqres.full
if [ -n "$remount_period" ]; then
# anything.
test "$mode" = "rw" && __stress_scrub_clean_scratch && continue
- timeout -s TERM "$remount_period" $FSSTRESS_PROG \
- $args $rw_arg >> $seqres.full
+ _run_fsstress_bg $args $rw_arg >> $seqres.full
+ sleep $remount_period
+ _kill_fsstress
res=$?
echo "$mode fsstress exits with $res at $(date)" >> $seqres.full
- if [ "$res" -ne 0 ] && [ "$res" -ne 124 ]; then
- # Stop if fsstress returns error. Mask off
- # the magic code 124 because that is how the
- # timeout(1) program communicates that we ran
- # out of time.
- break;
- fi
+ [ "$res" -ne 0 ] && break;
+
if [ "$mode" = "rw" ]; then
mode="ro"
rw_arg="-R"
while __stress_scrub_running "$end" "$runningfile"; do
# Need to recheck running conditions if we cleared anything
__stress_scrub_clean_scratch && continue
- $FSSTRESS_PROG $args >> $seqres.full
+ _run_fsstress $args >> $seqres.full
echo "fsstress exits with $? at $(date)" >> $seqres.full
done
rm -f "$runningfile"
# Send SIGINT so that bash won't print a 'Terminated' message that
# distorts the golden output.
echo "Killing stressor processes at $(date)" >> $seqres.full
- $KILLALL_PROG -INT xfs_io fsstress fsx xfs_scrub >> $seqres.full 2>&1
+ _kill_fsstress
+ $KILLALL_PROG -INT xfs_io fsx xfs_scrub >> $seqres.full 2>&1
# Tests are not allowed to exit with the scratch fs frozen. If we
# started a fs freeze/thaw background loop, wait for that loop to exit
"__stress_scrub_${exerciser}_loop" "$end" "$runningfile" \
"$remount_period" "$stress_tgt" &
+ _FSSTRESS_PID=$!
if [ -n "$freeze" ]; then
__stress_scrub_freeze_loop "$end" "$runningfile" &
# Standard cleanup function. Individual tests can override this.
_cleanup()
{
+ _kill_fsstress
cd /
rm -r -f $tmp.*
}
BC="$(type -P bc)" || BC=
+# Common execution handling for fsstress invocation.
+#
+# We need per-test fsstress binaries because of the way fsstress forks and
+# tests run it in the background and/or nest it. Trying to kill fsstress
+# tasks is unreliable because killing parent fsstress task does not guarantee
+# that the children get killed. Hence the historic use of killall for stopping
+# execution.
+#
+# However, we can't just kill all fsstress binaries as multiple tests might be
+# running fsstress at the same time. Hence copy the fsstress binary to a test
+# specific binary on the test device and use pkill to select that only that
+# task name to kill.
+#
+# If tasks want to start fsstress themselves (e.g. under a different uid) then
+# they can set up _FSSTRESS_BIN and record _FSSTRESS_PID themselves. Then if the
+# test is killed then it will get cleaned up automatically.
+
+_FSSTRESS_BIN="$seq.fsstress"
+_FSSTRESS_PROG="$TEST_DIR/$seq.fsstress"
+_FSSTRESS_PID=""
+_wait_for_fsstress()
+{
+ local ret=0
+
+ if [ -n "$_FSSTRESS_PID" ]; then
+ wait $_FSSTRESS_PID >> $seqres.full 2>&1
+ ret=$?
+ unset _FSSTRESS_PID
+ fi
+ rm -f $_FSSTRESS_PROG
+ return $ret
+}
+
+# Standard fsstress cleanup function. Individual tests can override this.
+_kill_fsstress()
+{
+ if [ -n "$_FSSTRESS_PID" ]; then
+ # use SIGPIPE to avoid "Killed" messages from bash
+ echo "killing $_FSSTRESS_BIN" >> $seqres.full
+ pkill -PIPE $_FSSTRESS_BIN >> $seqres.full 2>&1
+ _wait_for_fsstress
+ return $?
+ fi
+}
+
+_run_fsstress_bg()
+{
+ cp -f $FSSTRESS_PROG $_FSSTRESS_PROG
+ $_FSSTRESS_PROG $FSSTRESS_AVOID $* >> $seqres.full 2>&1 &
+ _FSSTRESS_PID=$!
+}
+
+_run_fsstress()
+{
+ _run_fsstress_bg $*
+ _wait_for_fsstress
+ return $?
+}
+
_wallclock()
{
date "+%s"
{
switch (signum) {
case SIGTERM:
+ case SIGPIPE:
should_stop = 1;
break;
case SIGBUS:
{
int ret;
+ if (should_stop)
+ return false;
+
if (deadline.tv_nsec) {
struct timespec now;
perror("sigaction failed");
exit(1);
}
+ if (sigaction(SIGPIPE, &action, 0)) {
+ perror("sigaction failed");
+ exit(1);
+ }
for (i = 0; i < nproc; i++) {
if (fork() == 0) {
sigemptyset(&action.sa_mask);
- action.sa_handler = SIG_DFL;
+ action.sa_handler = sg_handler;
if (sigaction(SIGTERM, &action, 0))
return 1;
- action.sa_handler = sg_handler;
if (sigaction(SIGBUS, &action, 0))
return 1;
#ifdef HAVE_SYS_PRCTL_H
{
int ret;
+ if (should_stop)
+ return false;
+
if (deadline.tv_nsec) {
struct timespec now;
# Override the default cleanup function.
_cleanup()
{
+ _kill_fsstress
rm $tmp.running
wait
rm -f $tmp.*
_scratch_mkfs_sized $fsz >>$seqres.full 2>&1
_scratch_mount
# -w ensures that the only ops are ones which cause write I/O
- run_check $FSSTRESS_PROG -d $SCRATCH_MNT -w -p $procs -n 2000 \
- $FSSTRESS_AVOID
+ _run_fsstress -d $SCRATCH_MNT -w -p $procs -n 2000
_btrfs subvolume snapshot $SCRATCH_MNT \
$SCRATCH_MNT/$snap_name
# make some noise but ensure we're not touching existing data
# extents.
- run_check $FSSTRESS_PROG -d $SCRATCH_MNT -p $procs -n 4000 \
+ _run_fsstress -d $SCRATCH_MNT -p $procs -n 4000 \
-z -f chown=3 -f link=1 -f mkdir=2 -f mknod=2 \
-f rename=2 -f setxattr=1 -f symlink=2
clean_dir="$SCRATCH_MNT/next"
mkdir $clean_dir
# now make more files to get a higher tree
- run_check $FSSTRESS_PROG -d $clean_dir -w -p $procs -n 2000 \
- $FSSTRESS_AVOID
+ _run_fsstress -d $clean_dir -w -p $procs -n 2000
run_check _scratch_unmount
_scratch_mount "-o atime"
# make background noise while backrefs are being walked
while [ -f "$tmp.running" ]; do
echo background fsstress >>$seqres.full
- run_check $FSSTRESS_PROG -d $SCRATCH_MNT/bgnoise -n 999
+ _run_fsstress -d $SCRATCH_MNT/bgnoise -n 999
echo background rm >>$seqres.full
rm -rf $SCRATCH_MNT/bgnoise/
done &
# Override the default cleanup function.
_cleanup()
{
+ _kill_fsstress
cd /
rm -f $tmp.*
rm -fr $send_files_dir
_scratch_mkfs_sized $fsz >>$seqres.full 2>&1
_scratch_mount "-o noatime"
- run_check $FSSTRESS_PROG -d $SCRATCH_MNT -n $ops $FSSTRESS_AVOID -x \
+ _run_fsstress -d $SCRATCH_MNT -n $ops -x \
"$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/base"
_btrfs subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/incr
echo "populating the initial ext fs:" >> $seqres.full
mkdir "$SCRATCH_MNT/$BASENAME"
-$FSSTRESS_PROG -w -d "$SCRATCH_MNT/$BASENAME" -n 20 -p 500 >> $seqres.full
+_run_fsstress -w -d "$SCRATCH_MNT/$BASENAME" -n 20 -p 500
# Create the checksum to verify later.
$FSSUM_PROG -A -f -w $tmp.original "$SCRATCH_MNT/$BASENAME"
echo "Generating new data on the converted btrfs" >> $seqres.full
mkdir -p $SCRATCH_MNT/new
-$FSSTRESS_PROG -w -d "$SCRATCH_MNT/new" -n 20 -p 500 >> $seqres.full
+_run_fsstress -w -d "$SCRATCH_MNT/new" -n 20 -p 500
_scratch_unmount
if [ ! -z "$balance_pid" ]; then
_btrfs_kill_stress_balance_pid $balance_pid
fi
- if [ ! -z "$fsstress_pid" ]; then
- kill $fsstress_pid &> /dev/null
- wait $fsstress_pid &> /dev/null
- fi
+ _kill_fsstress
}
. ./common/filter
-f fsync=10 -n 100000 -p 2 \
-d $SCRATCH_MNT/stress_dir`
echo "Run fsstress $args" >>$seqres.full
-$FSSTRESS_PROG $args >>$seqres.full &
-fsstress_pid=$!
+_run_fsstress_bg $args
echo "Start balance" >>$seqres.full
_btrfs_stress_balance -d $SCRATCH_MNT >/dev/null 2>&1 &
# 30s is enough to trigger bug
sleep $((30*$TIME_FACTOR))
-kill $fsstress_pid &> /dev/null
-wait $fsstress_pid &> /dev/null
+_kill_fsstress
_btrfs_kill_stress_balance_pid $balance_pid
-unset fsstress_pid balance_pid
+unset balance_pid
# The qgroups accounting will be checked by 'btrfs check' (fsck) after the
# fstests framework unmounts the filesystem.
-f write=10 -f creat=10 \
-n 1000 -p 2 -d $SCRATCH_MNT/stress_dir`
echo "Run fsstress $args" >>$seqres.full
-$FSSTRESS_PROG $args >>$seqres.full
+_run_fsstress $args >>$seqres.full
# Start and pause balance to ensure it will be restored on remount
echo "Start balance" >>$seqres.full
[ $? -eq 0 ] || _fail "Couldn't resume balance after device add"
# Add more files so that new balance won't fish immediately
-$FSSTRESS_PROG $args >/dev/null 2>&1
+_run_fsstress $args
# Now pause->resume balance. This ensures balance paused is properly set in
# the kernel and won't trigger an assertion failure.
_scratch_mount
# -w ensures that the only ops are ones which cause write I/O
-run_check $FSSTRESS_PROG -d $SCRATCH_MNT -w -p 5 -n 1000 $FSSTRESS_AVOID
+_run_fsstress -d $SCRATCH_MNT -w -p 5 -n 1000
_btrfs subvolume snapshot $SCRATCH_MNT \
$SCRATCH_MNT/snap1
-run_check $FSSTRESS_PROG -d $SCRATCH_MNT/snap1 -w -p 5 -n 1000 $FSSTRESS_AVOID
+_run_fsstress -d $SCRATCH_MNT/snap1 -w -p 5 -n 1000
_btrfs quota enable $SCRATCH_MNT
_btrfs quota rescan -w $SCRATCH_MNT
if [ ! -z "$balance_pid" ]; then
_btrfs_kill_stress_balance_pid $balance_pid
fi
- if [ ! -z "$fsstress_pid" ]; then
- kill $fsstress_pid &> /dev/null
- wait $fsstress_pid &> /dev/null
- fi
+ _kill_fsstress
}
. ./common/filter
fi
_scratch_mount >>$seqres.full 2>&1
- args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir`
+ args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir`
echo "Run fsstress $args" >>$seqres.full
- $FSSTRESS_PROG $args >>$seqres.full &
- fsstress_pid=$!
+ _run_fsstress_bg $args
echo -n "Start balance worker: " >>$seqres.full
_btrfs_stress_balance $SCRATCH_MNT >/dev/null 2>&1 &
echo "$subvol_pid" >>$seqres.full
echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full
- wait $fsstress_pid
- unset fsstress_pid
-
+ _wait_for_fsstress
_btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file $subvol_mnt
unset subvol_pid
_btrfs_kill_stress_balance_pid $balance_pid
if [ ! -z "$scrub_pid" ]; then
_btrfs_kill_stress_scrub_pid $scrub_pid
fi
- if [ ! -z "$fsstress_pid" ]; then
- kill $fsstress_pid &> /dev/null
- wait $fsstress_pid &> /dev/null
- fi
+ _kill_fsstress
}
. ./common/filter
fi
_scratch_mount >>$seqres.full 2>&1
- args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir`
+ args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir`
echo "Run fsstress $args" >>$seqres.full
- $FSSTRESS_PROG $args >>$seqres.full &
- fsstress_pid=$!
+ _run_fsstress_bg $args
echo -n "Start balance worker: " >>$seqres.full
_btrfs_stress_balance $SCRATCH_MNT >/dev/null 2>&1 &
echo "$scrub_pid" >>$seqres.full
echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full
- wait $fsstress_pid
- unset fsstress_pid
+ _wait_for_fsstress
_btrfs_kill_stress_balance_pid $balance_pid
unset balance_pid
_btrfs_kill_stress_scrub_pid $scrub_pid
if [ ! -z "$defrag_pid" ]; then
_btrfs_kill_stress_defrag_pid $defrag_pid
fi
- if [ ! -z "$fsstress_pid" ]; then
- kill $fsstress_pid &> /dev/null
- wait $fsstress_pid &> /dev/null
- fi
+ _kill_fsstress
}
. ./common/filter
fi
_scratch_mount >>$seqres.full 2>&1
- args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir`
+ args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir`
echo "Run fsstress $args" >>$seqres.full
- $FSSTRESS_PROG $args >>$seqres.full &
- fsstress_pid=$!
+ _run_fsstress_bg $args
echo -n "Start balance worker: " >>$seqres.full
_btrfs_stress_balance $SCRATCH_MNT >/dev/null 2>&1 &
echo "$defrag_pid" >>$seqres.full
echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full
- wait $fsstress_pid
- unset fsstress_pid
+ _wait_for_fsstress
_btrfs_kill_stress_balance_pid $balance_pid
unset balance_pid
_btrfs_kill_stress_defrag_pid $defrag_pid
if [ ! -z "$remount_pid" ]; then
_btrfs_kill_stress_remount_compress_pid $remount_pid $SCRATCH_MNT
fi
- if [ ! -z "$fsstress_pid" ]; then
- kill $fsstress_pid &> /dev/null
- wait $fsstress_pid &> /dev/null
- fi
+ _kill_fsstress
}
. ./common/filter
fi
_scratch_mount >>$seqres.full 2>&1
- args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir`
+ args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir`
echo "Run fsstress $args" >>$seqres.full
- $FSSTRESS_PROG $args >>$seqres.full &
- fsstress_pid=$!
+ _run_fsstress_bg $args
echo -n "Start balance worker: " >>$seqres.full
_btrfs_stress_balance $SCRATCH_MNT >/dev/null 2>&1 &
echo "$remount_pid" >>$seqres.full
echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full
- wait $fsstress_pid
- unset fsstress_pid
+ _wait_for_fsstress
_btrfs_kill_stress_balance_pid $balance_pid
unset balance_pid
_btrfs_kill_stress_remount_compress_pid $remount_pid $SCRATCH_MNT
if [ ! -z "$replace_pid" ]; then
_btrfs_kill_stress_replace_pid $replace_pid
fi
- if [ ! -z "$fsstress_pid" ]; then
- kill $fsstress_pid &> /dev/null
- wait $fsstress_pid &> /dev/null
- fi
+ _kill_fsstress
}
. ./common/filter
_scratch_mount >>$seqres.full 2>&1
SCRATCH_DEV_POOL=$saved_scratch_dev_pool
- args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir`
+ args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir`
echo "Run fsstress $args" >>$seqres.full
- $FSSTRESS_PROG $args >>$seqres.full &
- fsstress_pid=$!
+ _run_fsstress_bg $args
# Start both balance and replace in the background.
# Either balance or replace shall run, the other fails.
echo "$replace_pid" >>$seqres.full
echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full
- wait $fsstress_pid
- unset fsstress_pid
+ _wait_for_fsstress
_btrfs_kill_stress_balance_pid $balance_pid
unset balance_pid
_btrfs_kill_stress_replace_pid $replace_pid
if [ ! -z "$replace_pid" ]; then
_btrfs_kill_stress_replace_pid $replace_pid
fi
- if [ ! -z "$fsstress_pid" ]; then
- kill $fsstress_pid &> /dev/null
- wait $fsstress_pid &> /dev/null
- fi
+ _kill_fsstress
}
. ./common/filter
_scratch_mount >>$seqres.full 2>&1
SCRATCH_DEV_POOL=$saved_scratch_dev_pool
- args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir`
+ args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir`
echo "Run fsstress $args" >>$seqres.full
- $FSSTRESS_PROG $args >>$seqres.full &
- fsstress_pid=$!
+ _run_fsstress_bg $args
echo -n "Start subvolume worker: " >>$seqres.full
_btrfs_stress_subvolume $SCRATCH_DEV $SCRATCH_MNT subvol_$$ $subvol_mnt $stop_file >/dev/null 2>&1 &
echo "$replace_pid" >>$seqres.full
echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full
- wait $fsstress_pid
- unset fsstress_pid
-
+ _wait_for_fsstress
_btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file $subvol_mnt
unset subvol_pid
_btrfs_kill_stress_replace_pid $replace_pid
if [ ! -z "$scrub_pid" ]; then
_btrfs_kill_stress_scrub_pid $scrub_pid
fi
- if [ ! -z "$fsstress_pid" ]; then
- kill $fsstress_pid &> /dev/null
- wait $fsstress_pid &> /dev/null
- fi
+ _kill_fsstress
}
. ./common/filter
fi
_scratch_mount >>$seqres.full 2>&1
- args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir`
+ args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir`
echo "Run fsstress $args" >>$seqres.full
- $FSSTRESS_PROG $args >>$seqres.full &
- fsstress_pid=$!
+ _run_fsstress_bg $args
echo -n "Start subvolume worker: " >>$seqres.full
_btrfs_stress_subvolume $SCRATCH_DEV $SCRATCH_MNT subvol_$$ $subvol_mnt $stop_file >/dev/null 2>&1 &
echo "$scrub_pid" >>$seqres.full
echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full
- wait $fsstress_pid
- unset fsstress_pid
-
+ _wait_for_fsstress
_btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file $subvol_mnt
unset subvol_pid
_btrfs_kill_stress_scrub_pid $scrub_pid
if [ ! -z "$defrag_pid" ]; then
_btrfs_kill_stress_defrag_pid $defrag_pid
fi
- if [ ! -z "$fsstress_pid" ]; then
- kill $fsstress_pid &> /dev/null
- wait $fsstress_pid &> /dev/null
- fi
+ _kill_fsstress
}
. ./common/filter
fi
_scratch_mount >>$seqres.full 2>&1
- args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir`
+ args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir`
echo "Run fsstress $args" >>$seqres.full
- $FSSTRESS_PROG $args >>$seqres.full &
- fsstress_pid=$!
+ _run_fsstress_bg $args
echo -n "Start subvolume worker: " >>$seqres.full
_btrfs_stress_subvolume $SCRATCH_DEV $SCRATCH_MNT subvol_$$ $subvol_mnt $stop_file >/dev/null 2>&1 &
echo "$defrag_pid" >>$seqres.full
echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full
- wait $fsstress_pid
- unset fsstress_pid
-
+ _wait_for_fsstress
_btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file $subvol_mnt
unset subvol_pid
_btrfs_kill_stress_defrag_pid $defrag_pid
if [ ! -z "$remount_pid" ]; then
_btrfs_kill_stress_remount_compress_pid $remount_pid $SCRATCH_MNT
fi
- if [ ! -z "$fsstress_pid" ]; then
- kill $fsstress_pid &> /dev/null
- wait $fsstress_pid &> /dev/null
- fi
+ _kill_fsstress
}
. ./common/filter
fi
_scratch_mount >>$seqres.full 2>&1
- args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir`
+ args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir`
echo "Run fsstress $args" >>$seqres.full
- $FSSTRESS_PROG $args >>$seqres.full &
- fsstress_pid=$!
+ _run_fsstress_bg $args
echo -n "Start subvolume worker: " >>$seqres.full
_btrfs_stress_subvolume $SCRATCH_DEV $SCRATCH_MNT subvol_$$ $subvol_mnt $stop_file >/dev/null 2>&1 &
echo "$remount_pid" >>$seqres.full
echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full
- wait $fsstress_pid
- unset fsstress_pid
-
+ _wait_for_fsstress
_btrfs_kill_stress_subvolume_pid $subvol_pid $stop_file $subvol_mnt
unset subvol_pid
_btrfs_kill_stress_remount_compress_pid $remount_pid $SCRATCH_MNT
if [ ! -z "$scrub_pid" ]; then
_btrfs_kill_stress_scrub_pid $scrub_pid
fi
- if [ ! -z "$fsstress_pid" ]; then
- kill $fsstress_pid &> /dev/null
- wait $fsstress_pid &> /dev/null
- fi
+ _kill_fsstress
}
. ./common/filter
_scratch_mount >>$seqres.full 2>&1
SCRATCH_DEV_POOL=$saved_scratch_dev_pool
- args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir`
+ args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir`
echo "Run fsstress $args" >>$seqres.full
- $FSSTRESS_PROG $args >>$seqres.full &
- fsstress_pid=$!
+ _run_fsstress_bg $args
echo -n "Start replace worker: " >>$seqres.full
_btrfs_stress_replace $SCRATCH_MNT >>$seqres.full 2>&1 &
echo "$scrub_pid" >>$seqres.full
echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full
- wait $fsstress_pid
- unset fsstress_pid
+ _wait_for_fsstress
_btrfs_kill_stress_scrub_pid $scrub_pid
unset scrub_pid
_btrfs_kill_stress_replace_pid $replace_pid
if [ ! -z "$defrag_pid" ]; then
_btrfs_kill_stress_defrag_pid $defrag_pid
fi
- if [ ! -z "$fsstress_pid" ]; then
- kill $fsstress_pid &> /dev/null
- wait $fsstress_pid &> /dev/null
- fi
+ _kill_fsstress
}
. ./common/filter
_scratch_mount >>$seqres.full 2>&1
SCRATCH_DEV_POOL=$saved_scratch_dev_pool
- args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir`
+ args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir`
echo "Run fsstress $args" >>$seqres.full
- $FSSTRESS_PROG $args >>$seqres.full &
- fsstress_pid=$!
+ _run_fsstress_bg $args
echo -n "Start replace worker: " >>$seqres.full
_btrfs_stress_replace $SCRATCH_MNT >>$seqres.full 2>&1 &
echo "$defrag_pid" >>$seqres.full
echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full
- wait $fsstress_pid
- unset fsstress_pid
+ _wait_for_fsstress
_btrfs_kill_stress_replace_pid $replace_pid
unset replace_pid
_btrfs_kill_stress_defrag_pid $defrag_pid
if [ ! -z "$remount_pid" ]; then
_btrfs_kill_stress_remount_compress_pid $remount_pid $SCRATCH_MNT
fi
- if [ ! -z "$fsstress_pid" ]; then
- kill $fsstress_pid &> /dev/null
- wait $fsstress_pid &> /dev/null
- fi
+ _kill_fsstress
}
. ./common/filter
_scratch_mount >>$seqres.full 2>&1
SCRATCH_DEV_POOL=$saved_scratch_dev_pool
- args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir`
+ args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir`
echo "Run fsstress $args" >>$seqres.full
- $FSSTRESS_PROG $args >>$seqres.full &
- fsstress_pid=$!
+ _run_fsstress_bg $args
echo -n "Start replace worker: " >>$seqres.full
_btrfs_stress_replace $SCRATCH_MNT >>$seqres.full 2>&1 &
echo "$remount_pid" >>$seqres.full
echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full
- wait $fsstress_pid
- unset fsstress_pid
+ _wait_for_fsstress
_btrfs_kill_stress_replace_pid $replace_pid
unset replace_pid
_btrfs_kill_stress_remount_compress_pid $remount_pid $SCRATCH_MNT
if [ ! -z "$scrub_pid" ]; then
_btrfs_kill_stress_scrub_pid $scrub_pid
fi
- if [ ! -z "$fsstress_pid" ]; then
- kill $fsstress_pid &> /dev/null
- wait $fsstress_pid &> /dev/null
- fi
+ _kill_fsstress
}
. ./common/filter
fi
_scratch_mount >>$seqres.full 2>&1
- args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir`
+ args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir`
echo "Run fsstress $args" >>$seqres.full
- $FSSTRESS_PROG $args >>$seqres.full &
- fsstress_pid=$!
+ _run_fsstress_bg $args
echo -n "Start scrub worker: " >>$seqres.full
_btrfs_stress_scrub $SCRATCH_MNT >/dev/null 2>&1 &
echo "$defrag_pid" >>$seqres.full
echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full
- wait $fsstress_pid
- unset fsstress_pid
-
+ _wait_for_fsstress
_btrfs_kill_stress_defrag_pid $defrag_pid
unset defrag_pid
_btrfs_kill_stress_scrub_pid $scrub_pid
if [ ! -z "$scrub_pid" ]; then
_btrfs_kill_stress_scrub_pid $scrub_pid
fi
- if [ ! -z "$fsstress_pid" ]; then
- kill $fsstress_pid &> /dev/null
- wait $fsstress_pid &> /dev/null
- fi
+ _kill_fsstress
}
. ./common/filter
fi
_scratch_mount >>$seqres.full 2>&1
- args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir`
+ args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir`
echo "Run fsstress $args" >>$seqres.full
- $FSSTRESS_PROG $args >>$seqres.full &
- fsstress_pid=$!
+ _run_fsstress_bg $args
echo -n "Start scrub worker: " >>$seqres.full
_btrfs_stress_scrub $SCRATCH_MNT >/dev/null 2>&1 &
echo "$remount_pid" >>$seqres.full
echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full
- wait $fsstress_pid
- unset fsstress_pid
+ _wait_for_fsstress
_btrfs_kill_stress_remount_compress_pid $remount_pid $SCRATCH_MNT
unset remount_pid
_btrfs_kill_stress_scrub_pid $scrub_pid
if [ ! -z "$defrag_pid" ]; then
_btrfs_kill_stress_defrag_pid $defrag_pid
fi
- if [ ! -z "$fsstress_pid" ]; then
- kill $fsstress_pid &> /dev/null
- wait $fsstress_pid &> /dev/null
- fi
+ _kill_fsstress
}
. ./common/filter
fi
_scratch_mount >>$seqres.full 2>&1
- args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir`
+ args=`_scale_fsstress_args -p 20 -n 100 -d $SCRATCH_MNT/stressdir`
echo "Run fsstress $args" >>$seqres.full
- $FSSTRESS_PROG $args >>$seqres.full &
- fsstress_pid=$!
+ _run_fsstress_bg $args
echo -n "Start defrag worker: " >>$seqres.full
_btrfs_stress_defrag $SCRATCH_MNT $with_compress >/dev/null 2>&1 &
echo "$remount_pid" >>$seqres.full
echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full
- wait $fsstress_pid
- unset fsstress_pid
+ _wait_for_fsstress
_btrfs_kill_stress_remount_compress_pid $remount_pid $SCRATCH_MNT
unset remount_pid
_btrfs_kill_stress_defrag_pid $defrag_pid
. ./common/preamble
_begin_fstest auto snapshot
-tmp=`mktemp -d`
-
-# Override the default cleanup function.
-_cleanup()
-{
- rm -fr $tmp
-}
-
. ./common/filter
_require_scratch
snapshot_cmd="$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT"
snapshot_cmd="$snapshot_cmd $SCRATCH_MNT/snap_\`date +'%H_%M_%S_%N'\`"
- run_check $FSSTRESS_PROG -p $procs \
- -x "$snapshot_cmd" -X $num_snapshots -d $SCRATCH_MNT -n $ops
+ _run_fsstress -p $procs -x "$snapshot_cmd" -X $num_snapshots \
+ -d $SCRATCH_MNT -n $ops
}
ops=8000
# Override the default cleanup function.
_cleanup()
{
+ _kill_fsstress
_dmerror_cleanup
rm -f $tmp.*
}
snapshot_cmd="$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT"
snapshot_cmd="$snapshot_cmd $SCRATCH_MNT/snap_\`date +'%H_%M_%S_%N'\`"
-run_check $FSSTRESS_PROG -d $SCRATCH_MNT -n 200 -p 8 $FSSTRESS_AVOID -x \
- "$snapshot_cmd" -X 50
+_run_fsstress -d $SCRATCH_MNT -n 200 -p 8 -x "$snapshot_cmd" -X 50
# now load the error into the DMERROR_DEV
_dmerror_load_error_table
# Override the default cleanup function.
_cleanup()
{
+ _kill_fsstress
_dmerror_cleanup
rm -f $tmp.*
}
snapshot_cmd="$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT"
snapshot_cmd="$snapshot_cmd $SCRATCH_MNT/snap_\`date +'%H_%M_%S_%N'\`"
-run_check $FSSTRESS_PROG -d $SCRATCH_MNT -n 200 -p 8 $FSSTRESS_AVOID -x \
- "$snapshot_cmd" -X 50
+_run_fsstress -d $SCRATCH_MNT -n 200 -p 8 -x "$snapshot_cmd" -X 50
# now load the error into the DMERROR_DEV
_dmerror_load_error_table
populate_data(){
data_path=$1
mkdir -p $data_path
- args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $data_path`
+ args=`_scale_fsstress_args -p 20 -n 100 -d $data_path`
echo "Run fsstress $args" >>$seqres.full
- $FSSTRESS_PROG $args >>$seqres.full &
- fsstress_pid=$!
- wait $fsstress_pid
+ _run_fsstress $args
}
# Create & populate an ext3 filesystem
# Override the default cleanup function.
_cleanup()
{
- cd /
+ _kill_fsstress
kill -q $pid1 &> /dev/null
kill -q $pid2 &> /dev/null
- "$KILLALL_PROG" -q $FSSTRESS_PROG &> /dev/null
wait
_log_writes_cleanup &> /dev/null
+ cd /
rm -f $tmp.*
}
if [ $nr_cpus -gt 8 ]; then
nr_cpus=8
fi
-fsstress_args=$(_scale_fsstress_args -w -d $SCRATCH_MNT -n 99999 -p $nr_cpus \
- $FSSTRESS_AVOID)
+fsstress_args=$(_scale_fsstress_args -w -d $SCRATCH_MNT -n 99999 -p $nr_cpus )
_log_writes_init $SCRATCH_DEV
# Discard the whole devices so when some tree pointer is wrong, it won't point
delete_workload &
pid2=$!
-"$FSSTRESS_PROG" $fsstress_args >> $seqres.full &
+_run_fsstress_bg $fsstress_args
sleep $runtime
-"$KILLALL_PROG" -q "$FSSTRESS_PROG" &> /dev/null
+_kill_fsstress
kill $pid1 &> /dev/null
kill $pid2 &> /dev/null
wait
_scratch_mount
# Create random filesystem with 20k write ops
- $FSSTRESS_PROG -d $SCRATCH_MNT -w -n 10000 $FSSTRESS_AVOID >>$seqres.full 2>&1
+ _run_fsstress -d $SCRATCH_MNT -w -n 10000
_run_btrfs_balance_start -f -dconvert=$dst_type $SCRATCH_MNT >> $seqres.full
[ $? -eq 0 ] || echo "$1: Failed convert"
# Override the default cleanup function.
_cleanup()
{
- cd /
- rm -f $tmp.*
+ _kill_fsstress
kill $balance_pid &> /dev/null
kill $cancel_pid &> /dev/null
- "$KILLALL_PROG" -q $FSSTRESS_PROG &> /dev/null
- $BTRFS_UTIL_PROG balance cancel $SCRATCH_MNT &> /dev/null
wait
+ $BTRFS_UTIL_PROG balance cancel $SCRATCH_MNT &> /dev/null
+ cd /
+ rm -f $tmp.*
}
. ./common/filter
done
}
-$FSSTRESS_PROG -d $SCRATCH_MNT -w -n 100000 >> $seqres.full 2>/dev/null &
+_run_fsstress_bg -d $SCRATCH_MNT -w -n 100000
balance_workload &
balance_pid=$!
sleep $runtime
+_kill_fsstress
kill $balance_pid
kill $cancel_pid
-"$KILLALL_PROG" -q $FSSTRESS_PROG &> /dev/null
-$BTRFS_UTIL_PROG balance cancel $SCRATCH_MNT &> /dev/null
wait
+$BTRFS_UTIL_PROG balance cancel $SCRATCH_MNT &> /dev/null
echo "Silence is golden"
# success, all done
trap "wait; exit" SIGTERM
while true; do
- args=`_scale_fsstress_args -p 20 -n 1000 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir`
- $FSSTRESS_PROG $args >> $seqres.full
+ args=`_scale_fsstress_args -p 20 -n 1000 -d $SCRATCH_MNT/stressdir`
+ _run_fsstress $args
done
}
_cleanup()
{
+ _kill_fsstress
if [ ! -z $balance_pid ]; then
kill $balance_pid &> /dev/null
wait $balance_pid
# it's pointless to have them.
#
echo "Running fsstress..." >> $seqres.full
-$FSSTRESS_PROG $FSSTRESS_AVOID -d "$data_subvol" -p 1 -w \
+_run_fsstress -d "$data_subvol" -p 1 -w \
-f subvol_create=0 -f subvol_delete=0 -f snapshot=0 \
-x "$snapshot_cmd" -X $num_snapshots \
- -n $total_fsstress_ops >> $seqres.full
+ -n $total_fsstress_ops
snapshots=(`IFS=$'\n' ls -1 "$snapshots_dir"`)
# Then use fsstress to generate some extra contents.
# Disable setattr related operations, as it may set NODATACOW which will
# not allow us to use btrfs checksum to verify the content.
- $FSSTRESS_PROG -f setattr=0 -d $SCRATCH_MNT -w -n 3000 >> $seqres.full
+ _run_fsstress -f setattr=0 -d $SCRATCH_MNT -w -n 3000
sync
# Save the fssum of this fs
# Use a single process so that in case of failure it's easier to
# reproduce by using the same seed (logged in $seqres.full).
- run_check $FSSTRESS_PROG -d $SCRATCH_MNT -p 1 -n $((LOAD_FACTOR * 200)) \
- -w $FSSTRESS_AVOID -x "$snapshot_cmd"
+ _run_fsstress -d $SCRATCH_MNT -p 1 -n $((LOAD_FACTOR * 200)) \
+ -w -x "$snapshot_cmd"
$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap2 \
>> $seqres.full
# Use nodatasum mount option, so all data won't have checksum.
_scratch_mount -o nodatasum
- $FSSTRESS_PROG -p 10 -n 200 -d $SCRATCH_MNT >> $seqres.full
+ _run_fsstress -p 10 -n 200 -d $SCRATCH_MNT
sync
# Generate fssum for later verification, here we only care
$BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT | grep $subvolid >> \
$seqres.full 2>&1
[ $? -eq 0 ] || _fail "couldn't find our subvols quota group"
- run_check $FSSTRESS_PROG -d $SCRATCH_MNT/a -w -p 1 -n 2000 \
- $FSSTRESS_AVOID
+ _run_fsstress -d $SCRATCH_MNT/a -w -p 1 -n 2000
_btrfs subvolume snapshot $SCRATCH_MNT/a \
$SCRATCH_MNT/b
_btrfs subvolume create $SCRATCH_MNT/a
_btrfs quota enable $SCRATCH_MNT/a
subvolid=$(_btrfs_get_subvolid $SCRATCH_MNT a)
- run_check $FSSTRESS_PROG -d $SCRATCH_MNT/a -w -p 1 -n 2000 \
- $FSSTRESS_AVOID
+ _run_fsstress -d $SCRATCH_MNT/a -w -p 1 -n 2000
sync
output=$($BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT | grep "0/$subvolid")
echo "qgroup values before rescan: $output" >> $seqres.full
d2=$SCRATCH_MNT/d2
mkdir $d1
mkdir $d2
-run_check $FSSTRESS_PROG -d $d1 -w -n 2000 $FSSTRESS_AVOID
+_run_fsstress -d $d1 -w -n 2000
fssum_pre=$($FSSUM_PROG -A $SCRATCH_MNT)
# enable squotas
|| echo "fssum $fssum_pre does not match $fssum_post after enabling squota"
# do some more stuff
-run_check $FSSTRESS_PROG -d $d2 -w -n 2000 $FSSTRESS_AVOID
+_run_fsstress -d $d2 -w -n 2000
fssum_pre=$($FSSUM_PROG -A $SCRATCH_MNT)
_scratch_unmount
_check_btrfs_filesystem $SCRATCH_DEV
# Override the default cleanup function.
_cleanup()
{
+ _kill_fsstress
cd /
rm -f $tmp.*
# remove the generated data, which is much and meaningless.
echo "Run fsstress" >> $seqres.full
args=`_scale_fsstress_args -z -f creat=5 -f write=20 -f mkdir=5 -n 100 -p 15 -d $dump_dir`
echo "fsstress $args" >> $seqres.full
-
- $FSSTRESS_PROG $args >> $seqres.full 2>&1
+ _run_fsstress $args
echo "start Dump/Restore" >> $seqres.full
cd $TEST_DIR
. ./common/preamble
_begin_fstest auto ioctl
-# Override the default cleanup function.
-_cleanup()
-{
- cd /
- rm -r -f $tmp.*
- kill -9 $fsstress_pid 2>/dev/null;
- wait > /dev/null 2>&1
-}
-
# Import common functions.
. ./common/filter
# Begin fsstress while modifying UUID
fsstress_args=$(_scale_fsstress_args -d $SCRATCH_MNT -p 15 -n 999999)
-$FSSTRESS_PROG $fsstress_args >> $seqres.full &
-fsstress_pid=$!
+_run_fsstress_bg $fsstress_args
for n in $(seq 1 20); do
new_uuid=$($UUIDGEN_PROG)
fi
done
+_kill_fsstress
+
# success, all done
echo "Silence is golden"
status=0
. ./common/preamble
_begin_fstest auto quick
-
_supported_fs ext4
_fixed_by_kernel_commit a08f789d2ab5 \
"ext4: fix bug_on ext4_mb_use_inode_pa"
_scratch_mkfs -g 256 >> $seqres.full 2>&1 || _fail "mkfs failed"
_scratch_mount
-$FSSTRESS_PROG -d $SCRATCH_MNT/stress -n 1000 >> $seqres.full 2>&1
+_run_fsstress -d $SCRATCH_MNT/stress -n 1000
echo "Silence is golden"
echo ""
echo "Run fsstress"
out=$SCRATCH_MNT/fsstress.$$
- args=`_scale_fsstress_args -p4 -n999 -f setattr=1 $FSSTRESS_AVOID -d $out`
+ args=`_scale_fsstress_args -p4 -n999 -f setattr=1 -d $out`
echo "fsstress $args" >> $seqres.full
- $FSSTRESS_PROG $args >> $seqres.full
+ _run_fsstress $args
find $out -type f > $out.list
cat $out.list | xargs md5sum > $out.md5sum
usage=`du -sch $out | tail -n1 | gawk '{ print $1 }'`
. ./common/preamble
_begin_fstest other ioctl udf auto quick
-status=0 # success is the default!
-
-# Override the default cleanup function.
-_cleanup()
-{
- cd /
- # we might get here with a RO FS
- _test_cycle_mount
- # now remove fsstress directory.
- rm -rf $TEST_DIR/fsstress.$$.*
-}
-
# Import common functions.
. ./common/filter
_param="$2"
_count="$3"
- out=$TEST_DIR/fsstress.$$.$_n
+ out=$TEST_DIR/fsstress.$seq.$_n
rm -rf $out
if ! mkdir $out
then
echo "fsstress.$_n : $_param"
echo "-----------------------------------------------"
# -m limits number of users/groups so check doesn't fail (malloc) later
- dbgoutfile=$seqres.full
- if ! $FSSTRESS_PROG $_param $FSSTRESS_AVOID -v -m 8 -n $_count -d $out >>$dbgoutfile 2>&1
- then
+ _run_fsstress $_param -v -m 8 -n $_count -d $out
+ if [ $? -ne 0 ]; then
echo " fsstress (count=$_count) returned $? - see $seqres.full"
echo "--------------------------------------" >>$seqres.full
echo "$_n - output from fsstress:" >>$seqres.full
_require_test
echo "brevity is wit..."
+status=0
count=1000
procs=20
_do_test 3 "-p 4 -z -f rmdir=10 -f link=10 -f creat=10 -f mkdir=10 -f rename=30 -f stat=30 -f unlink=30 -f truncate=20" $count
-# if all ok by here then probably don't need $seqres.full
+rm -rf $TEST_DIR/fsstress.$seq.*
exit
# Override the default cleanup function.
_cleanup()
{
- kill $fs_pid $fio_pid &> /dev/null
+ _kill_fsstress
+ kill $fio_pid &> /dev/null
+ wait
_disallow_fail_make_request
cd /
rm -r -f $tmp.*
_workout()
{
out=$SCRATCH_MNT/fsstress.$$
- args=`_scale_fsstress_args -p 1 -n999999999 -f setattr=0 $FSSTRESS_AVOID -d $out`
+ args=`_scale_fsstress_args -p 1 -n999999999 -f setattr=0 -d $out`
echo ""
echo "Start fsstress.."
echo ""
echo "fsstress $args" >> $seqres.full
- $FSSTRESS_PROG $args >> $seqres.full 2>&1 &
- fs_pid=$!
+ _run_fsstress_bg $args
echo "Start fio.."
cat $fio_config >> $seqres.full
$FIO_PROG $fio_config >> $seqres.full 2>&1 &
>> $seqres.full 2>&1 && \
_fail "failed: still able to perform integrity fsync on $SCRATCH_MNT"
- kill $fs_pid &> /dev/null
- wait $fs_pid
+ _kill_fsstress
wait $fio_pid
- unset fs_pid
unset fio_pid
# We expect that broken FS still can be umounted
# Import common functions.
. ./common/filter
-# Override the default cleanup function.
-_cleanup()
-{
- cd /
- _scratch_unmount 2>/dev/null
- rm -f $tmp.*
-}
-
-
_require_scratch
_require_scratch_shutdown
-_require_command "$KILLALL_PROG" killall
_scratch_mkfs > $seqres.full 2>&1
_require_metadata_journaling $SCRATCH_DEV
load_dir=$SCRATCH_MNT/test
# let this run for a while
-$FSSTRESS_PROG $FSSTRESS_AVOID -n10000000 -p $PROCS -d $load_dir >> $seqres.full 2>&1 &
+_run_fsstress_bg -n 10000000 -p $PROCS -d $load_dir
sleep $SLEEP_TIME
-$KILLALL_PROG -q $FSSTRESS_PROG
-wait
+_kill_fsstress
sync
_scratch_unmount
# now mount again, run the load again, this time with a shutdown.
_scratch_mount
$XFS_FSR_PROG -v $load_dir >> $seqres.full 2>&1
-$FSSTRESS_PROG -n10000000 -p $PROCS -d $load_dir >> $seqres.full 2>&1 &
+_run_fsstress_bg -n10000000 -p $PROCS -d $load_dir
sleep $SLEEP_TIME
sync
# now shutdown and unmount
sleep 5
_scratch_shutdown
-$KILLALL_PROG -q $FSSTRESS_PROG
-wait
+_kill_fsstress
# for some reason fsstress processes manage to live on beyond the wait?
sleep 5
param="-p 4 -z -f rmdir=10 -f link=10 -f creat=10 -f mkdir=10 \
-f rename=30 -f stat=30 -f unlink=30 -f truncate=20"
_echofull "calling fsstress $param -m8 -n $count"
- FSSTRESS_ARGS=`_scale_fsstress_args $param $FSSTRESS_AVOID -m 8 -n $count -d $out`
- if ! $FSSTRESS_PROG $FSSTRESS_ARGS >>$seqres.full 2>&1
- then
+ FSSTRESS_ARGS=`_scale_fsstress_args $param -m 8 -n $count -d $out`
+ _run_fsstress $FSSTRESS_ARGS
+ if [ $? -ne 0 ]; then
_echofull "fsstress failed"
fi
}
{
# Make sure $SCRATCH_MNT is unfreezed
xfs_freeze -u $SCRATCH_MNT 2>/dev/null
- [ -n "$pid" ] && kill -9 $pid 2>/dev/null
- wait $pid
+ _kill_fsstress
cd /
rm -f $tmp.*
}
do
# We do both read & write IO - not only is this more realistic,
# but it also potentially tests atime updates
- FSSTRESS_ARGS=`_scale_fsstress_args -d $STRESS_DIR -p $procs -n $nops $FSSTRESS_AVOID`
- $FSSTRESS_PROG $FSSTRESS_ARGS >>$seqres.full
+ FSSTRESS_ARGS=`_scale_fsstress_args -d $STRESS_DIR -p $procs -n $nops`
+ _run_fsstress $FSSTRESS_ARGS >>$seqres.full
done
rm -r $STRESS_DIR/*
. ./common/preamble
_begin_fstest attr udf auto quick stress
-# Override the default cleanup function.
-_cleanup()
-{
- cd /
- rm -rf $TEST_DIR/fsstress
- rm -f $tmp.*
-}
-
# Import common functions.
. ./common/filter
. ./common/attr
-
_require_test
_require_attrs
-f attr_set=100 \
-f attr_remove=100 \
-p 1 -n 10000 -S c`
-$FSSTRESS_PROG $FSSTRESS_ARGS >$seqres.full 2>&1
+_run_fsstress $FSSTRESS_ARGS
+rm -rf $TEST_DIR/fsstress
status=$?
exit
# Override the default cleanup function.
_cleanup()
{
- echo "*** unmount"
- _scratch_unmount 2>/dev/null
_lets_get_pidst
+ cd /
+ rm -f $tmp.*
}
-_register_cleanup "_cleanup; rm -f $tmp.*"
# Import common functions.
. ./common/filter
-
_require_scratch
_require_local_device $SCRATCH_DEV
cat $SCRATCH_DEV >/dev/null &
pid=$!
-FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -p 2 -n 2000 $FSSTRESS_AVOID`
+FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -p 2 -n 2000`
echo "run fsstress with args: $FSSTRESS_ARGS" >>$seqres.full
-$FSSTRESS_PROG $FSSTRESS_ARGS >>$seqres.full
+_run_fsstress $FSSTRESS_ARGS
_lets_get_pidst
echo "*** done"
*** init fs
*** test concurrent block/fs access
*** done
-*** unmount
. ./common/preamble
_begin_fstest rw auto enospc stress
-# Override the default cleanup function.
-_cleanup()
-{
- echo "*** unmount"
- _scratch_unmount 2>/dev/null
- rm -f $tmp.*
-}
-
# Import common functions.
. ./common/filter
-
_require_scratch
_require_no_large_scratch_dev
_scratch_mount
# -w ensures that the only ops are ones which cause write I/O
- FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -w -p $procs -n $nops $FSSTRESS_AVOID`
- $FSSTRESS_PROG $FSSTRESS_ARGS >>$seqres.full
+ FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -w -p $procs -n $nops`
+ _run_fsstress $FSSTRESS_ARGS >>$seqres.full
}
echo "*** test out-of-space handling for random write operations"
QA output created by 083
*** test out-of-space handling for random write operations
*** done
-*** unmount
i=0
while [ $i -lt $ITERATIONS ]; do
echo fsstress iteration: $i | tee -a $seqres.full
- $FSSTRESS_PROG \
- -d $SCRATCH_MNT/fsstress \
- $fss_ops -S c >>$seqres.full 2>&1
+ _run_fsstress -d $SCRATCH_MNT/fsstress $fss_ops -S c
let i=$i+1
done
out=$SCRATCH_MNT/fsstress.$$
count=2000
- args=`_scale_fsstress_args -d $out -n $count -p 7 $FSSTRESS_AVOID`
+ args=`_scale_fsstress_args -d $out -n $count -p 7`
echo "fsstress $args" >> $seqres.full
- if ! $FSSTRESS_PROG $args | tee -a $seqres.full | _filter_num
+ if ! _run_fsstress $args
then
echo " fsstress $args returned $?"
- cat $tmp.out | tee -a $seqres.full
status=1
fi
}
Testing fsstress
-seed = S
Comparing user usage
Comparing group usage
num_iterations=10
enospc_time=2
out=$SCRATCH_MNT/fsstress.$$
- args=`_scale_fsstress_args -p128 -n999999999 -f setattr=1 $FSSTRESS_AVOID -d $out`
+ args=`_scale_fsstress_args -p128 -n999999999 -f setattr=1 -d $out`
echo "fsstress $args" >> $seqres.full
- $FSSTRESS_PROG $args &>> $seqres.full &
- pid=$!
+ _run_fsstress_bg $args
echo "Run dd writers in parallel"
for ((i=0; i < num_iterations; i++))
do
sleep $enospc_time
done
echo "Killing fsstress process..." >> $seqres.full
- kill $pid >> $seqres.full 2>&1
- wait $pid
+ _kill_fsstress
}
_require_scratch
args=`_scale_fsstress_args -p128 -n999999999 -f setattr=1 $FSSTRESS_AVOID -d $out`
echo "fsstress $args" >> $seqres.full
# Grant chown capability
- cp $FSSTRESS_PROG $tmp.fsstress.bin
- $SETCAP_PROG cap_chown=epi $tmp.fsstress.bin
+ cp $FSSTRESS_PROG $_FSSTRESS_PROG
+ $SETCAP_PROG cap_chown=epi $_FSSTRESS_PROG
# io_uring accounts memory it needs under the rlimit memlocked option,
# which can be quite low on some setups (especially 64K pagesize). root
# io_uring_queue_init fail on ENOMEM, set max locked memory to unlimited
# temporarily.
ulimit -l unlimited
- (su $qa_user -c "$tmp.fsstress.bin $args" &) > /dev/null 2>&1
+ su $qa_user -c "$_FSSTRESS_PROG $args" > /dev/null 2>&1 &
+ _FSSTRESS_PID=$!
echo "Run dd writers in parallel"
for ((i=0; i < num_iterations; i++))
sleep $enospc_time
done
- $KILLALL_PROG -w $tmp.fsstress.bin
+ _kill_fsstress
}
_require_quota
. ./common/preamble
_begin_fstest shutdown auto log metadata recoveryloop
-# Override the default cleanup function.
-_cleanup()
-{
- cd /
- rm -f $tmp.*
- $KILLALL_PROG -9 fsstress > /dev/null 2>&1
- _scratch_unmount > /dev/null 2>&1
-}
-
-# Import common functions.
-
-# Modify as appropriate.
-
_require_scratch
_require_local_device $SCRATCH_DEV
_require_scratch_shutdown
-_require_command "$KILLALL_PROG" "killall"
echo "Silence is golden."
_scratch_mount
while _soak_loop_running $((50 * TIME_FACTOR)); do
- ($FSSTRESS_PROG $FSSTRESS_AVOID -d $SCRATCH_MNT -n 999999 -p 4 >> $seqres.full &) \
- > /dev/null 2>&1
+ _run_fsstress_bg -d $SCRATCH_MNT -n 999999 -p 4
# purposely include 0 second sleeps to test shutdown immediately after
# recovery
sleep $((RANDOM % 3))
_scratch_shutdown
- ps -e | grep fsstress > /dev/null 2>&1
- while [ $? -eq 0 ]; do
- $KILLALL_PROG -9 fsstress > /dev/null 2>&1
- wait > /dev/null 2>&1
- ps -e | grep fsstress > /dev/null 2>&1
- done
+ _kill_fsstress
# Toggle between rw and ro mounts for recovery. Quit if any mount
# attempt fails so we don't shutdown the host fs.
[ -n "$freeze_pids" ] && kill -9 $freeze_pids 2>/dev/null
wait $freeze_pids
xfs_freeze -u $SCRATCH_MNT 2>/dev/null
- [ -n "$fsstress_pid" ] && kill -9 $fsstress_pid 2>/dev/null
- wait $fsstress_pid
+ _kill_fsstress
rm -f $tmp.*
}
nops=1000
stress_dir="$SCRATCH_MNT/fsstress_test_dir"
mkdir "$stress_dir"
-fsstress_args=`_scale_fsstress_args -d $stress_dir -p $procs -n $nops $FSSTRESS_AVOID`
-$FSSTRESS_PROG $fsstress_args >>$seqres.full 2>&1 &
-fsstress_pid=$!
+fsstress_args=`_scale_fsstress_args -d $stress_dir -p $procs -n $nops`
+_run_fsstress_bg $fsstress_args
# Start multi-threads freeze/unfreeze
for ((i=0; i<$procs; i++)); do
freeze_pids="$! $freeze_pids"
done
-wait $fsstress_pid
+_wait_for_fsstress
result=$?
-unset fsstress_pid
wait $freeze_pids
unset freeze_pids
# Override the default cleanup function.
_cleanup()
{
- cd /
- rm -f $tmp.*
+ _kill_fsstress
_clear_mount_stack
# make sure there's no bug cause dentry isn't be freed
rm -rf $MNTHEAD
+ cd /
+ rm -f $tmp.*
}
# Import common functions.
{
local target=$1
- $FSSTRESS_PROG -z -n 50 -p 3 \
+ _run_fsstress -z -n 50 -p 3 \
-f creat=5 \
-f mkdir=5 \
-f link=2 \
-f chown=1 \
-f getdents=1 \
-f fiemap=1 \
- -d $target >>$seqres.full
+ -d $target
sync
}
# Override the default cleanup function.
_cleanup()
{
- cd /
- rm -f $tmp.*
+ _kill_fsstress
_clear_mount_stack
# make sure there's no bug cause dentry isn't be freed
rm -rf $MNTHEAD
+ cd /
+ rm -f $tmp.*
}
# Import common functions.
{
local target=$1
- $FSSTRESS_PROG -z -n 50 -p 3 \
+ _run_fsstress -z -n 50 -p 3 \
-f creat=5 \
-f mkdir=5 \
-f link=2 \
-f chown=1 \
-f getdents=1 \
-f fiemap=1 \
- -d $target >>$seqres.full
+ -d $target
sync
}
# Override the default cleanup function.
_cleanup()
{
- cd /
- rm -f $tmp.*
+ _kill_fsstress
_clear_mount_stack
# make sure there's no bug cause dentry isn't be freed
rm -rf $MNTHEAD
+ cd /
+ rm -f $tmp.*
}
# Import common functions.
{
local target=$1
- $FSSTRESS_PROG -z -n 500 -p 5 \
+ _run_fsstress -z -n 500 -p 5 \
-f creat=5 \
-f mkdir=5 \
-f dwrite=1 \
-f chown=1 \
-f getdents=1 \
-f fiemap=1 \
- -d $target >>$seqres.full
+ -d $target
sync
}
# Import common functions.
. ./common/filter
-# Override the default cleanup function.
-_cleanup()
-{
- cd /
- _scratch_unmount 2>/dev/null
- rm -f $tmp.*
-}
-
-
_require_scratch_nocheck
_require_scratch_shutdown
-_require_command "$KILLALL_PROG" killall
_scratch_mkfs > $seqres.full 2>&1
_scratch_mount
load_dir=$SCRATCH_MNT/test
-$FSSTRESS_PROG $FSSTRESS_AVOID -n10000000 -p $PROCS -d $load_dir >> $seqres.full 2>&1 &
+_run_fsstress_bg -n10000000 -p $PROCS -d $load_dir
sleep $SLEEP_TIME
sync
# now shutdown and unmount
sleep 5
_scratch_shutdown
-$KILLALL_PROG -q $FSSTRESS_PROG
-wait
+_kill_fsstress
# for some reason fsstress processes manage to live on beyond the wait?
sleep 5
# Override the default cleanup function.
_cleanup()
{
- cd /
- rm -f $tmp.*
- $KILLALL_PROG -9 fsstress > /dev/null 2>&1
+ _kill_fsstress
_dmerror_unmount
_dmerror_cleanup
+ cd /
+ rm -f $tmp.*
}
# Import common functions.
_require_scratch
_require_dm_target error
-_require_command "$KILLALL_PROG" "killall"
echo "Silence is golden."
_dmerror_mount
while _soak_loop_running $((50 * TIME_FACTOR)); do
- ($FSSTRESS_PROG $FSSTRESS_AVOID -d $SCRATCH_MNT -n 999999 -p $((LOAD_FACTOR * 4)) >> $seqres.full &) \
- > /dev/null 2>&1
+ _run_fsstress_bg -d $SCRATCH_MNT -n 999999 -p $((LOAD_FACTOR * 4))
# purposely include 0 second sleeps to test shutdown immediately after
# recovery
# error table helper *without* 'lockfs'.
_dmerror_load_error_table
- ps -e | grep fsstress > /dev/null 2>&1
- while [ $? -eq 0 ]; do
- $KILLALL_PROG -9 fsstress > /dev/null 2>&1
- wait > /dev/null 2>&1
- ps -e | grep fsstress > /dev/null 2>&1
- done
+ _kill_fsstress
# Mount again to replay log after loading working table, so we have a
# consistent XFS after test.
. ./common/preamble
_begin_fstest auto rw long_rw stress soak smoketest
-# Override the default cleanup function.
-_cleanup()
-{
- cd /
- rm -f $tmp.*
- $KILLALL_PROG -9 fsstress > /dev/null 2>&1
-}
-
-# Import common functions.
-
-# Modify as appropriate.
-
_require_scratch
-_require_command "$KILLALL_PROG" "killall"
echo "Silence is golden."
fsstress_args=(-w -d $SCRATCH_MNT -n $nr_ops -p $nr_cpus)
test -n "$SOAK_DURATION" && fsstress_args+=(--duration="$SOAK_DURATION")
-$FSSTRESS_PROG $FSSTRESS_AVOID "${fsstress_args[@]}" >> $seqres.full
+_run_fsstress_bg "${fsstress_args[@]}"
# success, all done
status=0
# failure leaves the corpse intact for post-mortem failure analysis.
_cleanup()
{
- cd /
- $KILLALL_PROG -KILL -q $FSSTRESS_PROG &> /dev/null
+ _kill_fsstress
_log_writes_cleanup &> /dev/null
_dmthin_cleanup
+ cd /
rm -f $tmp.*
}
#_cleanup()
#{
# cd /
-# $KILLALL_PROG -KILL -q $FSSTRESS_PROG &> /dev/null
+# [ -n "$fsstress_pid" ] && kill $fsstress_pid
# if [ $status -eq 0 ]; then
# _log_writes_cleanup &> /dev/null
# _dmthin_cleanup
# Modify as appropriate.
_require_no_logdev
-_require_command "$KILLALL_PROG" killall
# Use thin device as replay device, which requires $SCRATCH_DEV
_require_scratch_nocheck
# and we need extra device as log device
if [ $nr_cpus -gt 8 ]; then
nr_cpus=8
fi
-fsstress_args=$(_scale_fsstress_args -w -d $SCRATCH_MNT -n 512 -p $nr_cpus \
- $FSSTRESS_AVOID)
+fsstress_args=$(_scale_fsstress_args -w -d $SCRATCH_MNT -n 512 -p $nr_cpus)
size=$(_small_fs_size_mb 200) # 200m phys/virt size
devsize=$((1024*1024*size / 512))
_log_writes_mark mkfs
_log_writes_mount
-run_check $FSSTRESS_PROG $fsstress_args
+_run_fsstress $fsstress_args
_log_writes_unmount
_log_writes_remove
# Override the default cleanup function.
_cleanup()
{
+ _kill_fsstress
_cleanup_flakey
cd /
rm -f $tmp.*
_mount_flakey
mkdir $SCRATCH_MNT/test
-args=`_scale_fsstress_args -p 4 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/test`
+args=`_scale_fsstress_args -p 4 -n 100 -d $SCRATCH_MNT/test`
args="$args -f mknod=0 -f symlink=0"
echo "Running fsstress with arguments: $args" >>$seqres.full
-$FSSTRESS_PROG $args >>$seqres.full
+_run_fsstress $args
# Fsync every file and directory.
find $SCRATCH_MNT/test \( -type f -o -type d \) -exec $XFS_IO_PROG -c fsync {} \;
find $dest -type f -exec md5sum {} \; \
> $md5file$index
# Make some noise
- $FSSTRESS_PROG $fsstress_opts -d $noisedir \
- -n 200 -p $((5 * LOAD_FACTOR)) >/dev/null 2>&1
+ _run_fsstress $fsstress_opts -d $noisedir \
+ -n 200 -p $((5 * LOAD_FACTOR))
# Too many output, so only save error output
$DUPEREMOVE_PROG -dr --dedupe-options=same $dupdir \
>/dev/null 2>$seqres.full
fsstress_opts="-w -r"
# Create some files to be original data
-$FSSTRESS_PROG $fsstress_opts -d $srcdir \
- -n 500 -p $((5 * LOAD_FACTOR)) >/dev/null 2>&1
+_run_fsstress $fsstress_opts -d $srcdir -n 500 -p $((5 * LOAD_FACTOR))
# Calculate how many test cycles will be run
src_size=`du -ks $srcdir | awk '{print $1}'`
# Override the default cleanup function.
_cleanup()
{
+ end_test
cd /
rm -f $tmp.*
- end_test
}
# Import common functions.
. ./common/reflink
_require_scratch_duperemove
-_require_command "$KILLALL_PROG" killall
_scratch_mkfs > $seqres.full 2>&1
_scratch_mount >> $seqres.full 2>&1
function end_test()
{
- local f=1
+ _kill_fsstress
# stop duperemove running
if [ -e $dupe_run ]; then
rm -f $dupe_run
- $KILLALL_PROG -q $DUPEREMOVE_PROG > /dev/null 2>&1
+ pkill $dedup_bin >/dev/null 2>&1
wait $dedup_pids
+ rm -f $dedup_prog
fi
-
- # Make sure all fsstress get killed
- while [ $f -ne 0 ]; do
- $KILLALL_PROG -q $FSSTRESS_PROG > /dev/null 2>&1
- sleep 1
- f=`ps -eLf | grep $FSSTRESS_PROG | grep -v "grep" | wc -l`
- done
}
sleep_time=$((50 * TIME_FACTOR))
testdir="$SCRATCH_MNT/dir"
mkdir $testdir
fsstress_opts="-r -n 1000 -p $((5 * LOAD_FACTOR))"
-$FSSTRESS_PROG $fsstress_opts -d $testdir -l 0 >> $seqres.full 2>&1 &
+_run_fsstress_bg $fsstress_opts -d $testdir -l 0
+
+dedup_bin=${seq}.duperemove
+dedup_prog=$TEST_DIR/$dedup_bin
+cp -f $DUPEREMOVE_PROG $dedup_prog
dedup_pids=""
dupe_run=$TEST_DIR/${seq}-running
# Start several dedupe processes on same directory
# dupremove processes in an arbitrary order, which leaves the
# memory in an inconsistent state long enough for the assert
# to trip.
- cmd="$DUPEREMOVE_PROG -dr --dedupe-options=same $testdir"
+ cmd="$dedup_prog -dr --dedupe-options=same $testdir"
bash -c "$cmd" >> $seqres.full 2>&1
done 2>&1 | sed -e '/Terminated/d' &
dedup_pids="$! $dedup_pids"
_cleanup()
{
# Stop all subprocesses.
- $KILLALL_PROG -q $FSSTRESS_PROG
+ _kill_fsstress
touch $tmp.done
wait
. ./common/verity
_require_scratch_verity
-_require_command "$KILLALL_PROG" killall
_disable_fsverity_signatures
_scratch_mkfs_verity &>> $seqres.full
) &
# Start the fsstress processes.
-$FSSTRESS_PROG $FSSTRESS_AVOID -p $nproc_stress -l 0 -d $SCRATCH_MNT/stressdir \
- >> $seqres.full 2>&1 &
+_run_fsstress_bg -p $nproc_stress -l 0 -d $SCRATCH_MNT/stressdir
# Run for a while.
sleep $runtime
# start a create and rename(rename_whiteout) workload. These processes
# occur simultaneously may cause the deadlock between AGI and AGF with
# RENAME_WHITEOUT.
-$FSSTRESS_PROG -z -n 150 -p 100 \
+_run_fsstress -z -n 150 -p 100 \
-f mknod=5 \
-f rwhiteout=5 \
- -d $SCRATCH_MNT/fsstress >> $seqres.full 2>&1
+ -d $SCRATCH_MNT/fsstress
echo Silence is golden
# Override the default cleanup function.
_cleanup()
{
- cd /
- rm -f $tmp.*
+ _kill_fsstress
_clear_mount_stack
# make sure there's no bug cause dentry isn't be freed
rm -rf $MNTHEAD
+ cd /
+ rm -f $tmp.*
}
# Import common functions.
{
local target=$1
- $FSSTRESS_PROG -n 50 -p 3 -d $target >>$seqres.full
+ _run_fsstress -n 50 -p 3 -d $target
sync
}
. ./common/preamble
_begin_fstest auto soak attr long_rw stress smoketest
-_cleanup()
-{
- $KILLALL_PROG -9 fsstress > /dev/null 2>&1
- cd /
- rm -f $tmp.*
-}
-
# Modify as appropriate.
_require_scratch
-_require_command "$KILLALL_PROG" "killall"
echo "Silence is golden."
args+=('-f' "attr_set=60") # sets larger xattrs
test -n "$SOAK_DURATION" && args+=(--duration="$SOAK_DURATION")
-$FSSTRESS_PROG "${args[@]}" $FSSTRESS_AVOID -d $SCRATCH_MNT -n $nr_ops -p $nr_cpus >> $seqres.full
+_run_fsstress "${args[@]}" -d $SCRATCH_MNT -n $nr_ops -p $nr_cpus
# success, all done
status=0
_cleanup()
{
- cd /
- $KILLALL_PROG -9 fsstress > /dev/null 2>&1
- wait
+ _kill_fsstress
if [ -n "$loopmnt" ]; then
$UMOUNT_PROG $loopmnt 2>/dev/null
rm -r -f $loopmnt
fi
- rm -f $tmp.*
_dmerror_unmount
_dmerror_cleanup
+ cd /
+ rm -f $tmp.*
}
# Import common functions.
_require_scratch_reflink
_require_cp_reflink
_require_dm_target error
-_require_command "$KILLALL_PROG" "killall"
_require_loop
echo "Silence is golden."
rm -f "$snap_aliveflag"
}
-fsstress=($FSSTRESS_PROG $FSSTRESS_AVOID -d "$loopmnt" -n 999999 -p "$((LOAD_FACTOR * 4))")
-
while _soak_loop_running $((25 * TIME_FACTOR)); do
touch $scratch_aliveflag
snap_loop_fs >> $seqres.full 2>&1 &
break
fi
- ("${fsstress[@]}" >> $seqres.full &) > /dev/null 2>&1
+ _run_fsstress_bg -d "$loopmnt" -n 999999 -p "$((LOAD_FACTOR * 4))"
# purposely include 0 second sleeps to test shutdown immediately after
# recovery
# error table helper *without* 'lockfs'.
_dmerror_load_error_table
- ps -e | grep fsstress > /dev/null 2>&1
- while [ $? -eq 0 ]; do
- $KILLALL_PROG -9 fsstress > /dev/null 2>&1
- wait > /dev/null 2>&1
- ps -e | grep fsstress > /dev/null 2>&1
- done
+ _kill_fsstress
for ((j = 0; j < 10; j++)); do
test -e "$snap_aliveflag" || break
sleep 1
# Override the default cleanup function.
_cleanup()
{
- cd /
- rm -f $tmp.*
- $KILLALL_PROG -9 fsstress > /dev/null 2>&1
+ _kill_fsstress
wait # for exercise_cpu_hotplug subprocess
for i in "$sysfs_cpu_dir/"cpu*/online; do
echo 1 > "$i" 2>/dev/null
done
test -n "$stress_dir" && rm -r -f "$stress_dir"
+ cd /
+ rm -f $tmp.*
}
exercise_cpu_hotplug()
}
_require_test
-_require_command "$KILLALL_PROG" "killall"
sysfs_cpu_dir="/sys/devices/system/cpu"
fsstress_args+=(-p $nr_cpus)
if [ -n "$SOAK_DURATION" ]; then
test "$SOAK_DURATION" -lt 10 && SOAK_DURATION=10
- fsstress_args+=(--duration="$((SOAK_DURATION / 10))")
+else
+ # run for 30s per iteration max
+ SOAK_DURATION=300
fi
+fsstress_args+=(--duration="$((SOAK_DURATION / 10))")
nr_ops=$((2500 * TIME_FACTOR))
fsstress_args+=(-n $nr_ops)
for ((i = 0; i < 10; i++)); do
- $FSSTRESS_PROG $FSSTRESS_AVOID -w "${fsstress_args[@]}" >> $seqres.full
+ _run_fsstress_bg -w "${fsstress_args[@]}"
+ _wait_for_fsstress
_test_cycle_mount
done
_cleanup()
{
- cd /
+ _kill_fsstress
rm -f $runfile
- rm -f $tmp.*
kill -9 $trigger_compaction_pid > /dev/null 2>&1
- $KILLALL_PROG -9 fsstress > /dev/null 2>&1
-
wait > /dev/null 2>&1
+ rm -f $tmp.*
+ cd /
}
# Import common functions.
_require_scratch
_require_vm_compaction
-_require_command "$KILLALL_PROG" "killall"
# We still deadlock with this test on v6.10-rc2, we need more work.
# but the below makes things better.
done &
trigger_compaction_pid=$!
-$FSSTRESS_PROG $FSSTRESS_AVOID "${fsstress_args[@]}" >> $seqres.full
+_run_fsstress "${fsstress_args[@]}"
rm -f $runfile
wait > /dev/null 2>&1
# Override the default cleanup function.
_cleanup()
{
- cd /
- rm -f $tmp.*
- $KILLALL_PROG -9 fsstress > /dev/null 2>&1
+ _kill_fsstress
_dmerror_unmount
_dmerror_cleanup
+ cd /
+ rm -f $tmp.*
}
# Import common functions.
_require_scratch
_require_dm_target error
-_require_command "$KILLALL_PROG" "killall"
echo "Silence is golden."
args+=('-f' "attr_set=60") # sets larger xattrs
while _soak_loop_running $((50 * TIME_FACTOR)); do
- ($FSSTRESS_PROG "${args[@]}" $FSSTRESS_AVOID -d $SCRATCH_MNT -n 999999 -p $((LOAD_FACTOR * 4)) >> $seqres.full &) \
- > /dev/null 2>&1
+ _run_fsstress_bg "${args[@]}" -d $SCRATCH_MNT -n 999999 -p $((LOAD_FACTOR * 4))
# purposely include 0 second sleeps to test shutdown immediately after
# recovery
# error table helper *without* 'lockfs'.
_dmerror_load_error_table
- ps -e | grep fsstress > /dev/null 2>&1
- while [ $? -eq 0 ]; do
- $KILLALL_PROG -9 fsstress > /dev/null 2>&1
- wait > /dev/null 2>&1
- ps -e | grep fsstress > /dev/null 2>&1
- done
+ _kill_fsstress
# Mount again to replay log after loading working table, so we have a
# consistent XFS after test.
. ./common/preamble
_begin_fstest auto stress
+# This nests multiple background fsstress instances, so we have to
+# do some magic with _FSSTRESS_PID here.
+_cleanup()
+{
+ if [ -n "$fsstress_pid_1" ]; then
+ FSTRESS_PID=$fsstress_pid_1
+ _kill_fsstress
+ fi
+ if [ -n "$fsstress_pid_2" ]; then
+ FSTRESS_PID=$fsstress_pid_2
+ _kill_fsstress
+ fi
+ cd /
+ rm -f tmp.*
+}
+
# Import common functions.
. ./common/filter
d_top=$SCRATCH_MNT/fsstress
mkdir -p $d_low $d_top
-echo $FSSTRESS_PROG -s 42 -d $d_low -p 4 -n 1000 -l100 -v > $seqres.full.1
-$FSSTRESS_PROG -s 42 -d $d_low -p 4 -n 1000 -l100 -v >> $seqres.full.1 2>&1 &
+echo fsstress -s 42 -d $d_low -p 4 -n 1000 -l100 -v >> $seqres.full
+_run_fsstress_bg -s 42 -d $d_low -p 4 -n 1000 -l100 -v
+fsstress_pid_1=$_FSSTRESS_PID
-echo $FSSTRESS_PROG -s 42 -d $d_top -p 4 -n 1000 -l100 -v > $seqres.full.2
-$FSSTRESS_PROG -s 42 -d $d_top -p 4 -n 1000 -l100 -v >> $seqres.full.2 2>&1 &
+echo fsstress -s 42 -d $d_top -p 4 -n 1000 -l100 -v >> $seqres.full
+_run_fsstress_bg -s 42 -d $d_top -p 4 -n 1000 -l100 -v
+fsstress_pid_2=$_FSTRESS_PID
+unset _FSSTRESS_PID
ret=0
-if ! wait %1; then
- echo "--------------------------------------" >>$seqres.full.1
- echo "fsstress on lower directory returned $? - see $seqres.full.1"
- echo "--------------------------------------" >>$seqres.full.1
+if ! wait $fsstress_pid_1; then
+ echo "--------------------------------------" >>$seqres.full
+ echo "fsstress on lower directory returned $? - see $seqres.full"
+ echo "--------------------------------------" >>$seqres.full
ret=1
fi
+unset fsstress_pid_1
-if ! wait %2; then
- echo "--------------------------------------" >>$seqres.full.2
- echo "fsstress on overlay directory returned $? - see $seqres.full.2"
- echo "--------------------------------------" >>$seqres.full.2
+if ! wait $fsstress_pid_2; then
+ echo "--------------------------------------" >>$seqres.full
+ echo "fsstress on overlay directory returned $? - see $seqres.full"
+ echo "--------------------------------------" >>$seqres.full
ret=1
fi
-
-cat $seqres.full.1 $seqres.full.2 > $seqres.full
-rm $seqres.full.1 $seqres.full.2
+unset fsstress_pid_2
if [ "$ret" -eq 1 ]; then
status=1
mkdir -p $d_low
# Create 4K empty files in 4 directories
-echo $FSSTRESS_PROG -d $d_low -p 4 -z -f creat=1 -n 1024 -v >> $seqres.full
-$FSSTRESS_PROG -d $d_low -p 4 -z -f creat=1 -n 1024 -v >> $seqres.full 2>&1
+echo fsstress -d $d_low -p 4 -z -f creat=1 -n 1024 -v >> $seqres.full
+_run_fsstress -d $d_low -p 4 -z -f creat=1 -n 1024 -v
echo "--------------------------------------" >> $seqres.full
echo "Created 1K files in lower directory. " >> $seqres.full
# Give team 'touch' a 1 second head start.
# Team 'truncate' players should catch up after few copy up bombs.
sleep 1
-$FSSTRESS_PROG -d $d_top -p 4 -z -f creat=1 -n 1024 -v >> $seqres.full &
+_run_fsstress -d $d_top -p 4 -z -f creat=1 -n 1024 -v
-wait %1 %2 %3 %4 %5
+wait %1 %2 %3 %4
echo "Silence is golden"
status=0
# Override the default cleanup function.
_cleanup()
{
+ _kill_fsstress
+ _dmerror_cleanup
cd /
rm -f $tmp.*
- _dmerror_cleanup
}
# Import common functions.
# start a metadata-intensive workload, but no data allocation operation.
# Because uncompleted new space allocation I/Os may cause XFS to shutdown
# after loading error table.
-$FSSTRESS_PROG -z -n 5000 -p 10 \
+_run_fsstress -z -n 5000 -p 10 \
-f creat=10 \
-f resvsp=1 \
-f truncate=1 \
-f unlink=1 \
-f symlink=1 \
-f rename=1 \
- -d $SCRATCH_MNT/fsstress >> $seqres.full 2>&1
+ -d $SCRATCH_MNT/fsstress
# Loading error table without "--nolockfs" option. Because "--nolockfs"
# won't freeze fs, then some running I/Os may cause XFS to shutdown
{
# Make sure $SCRATCH_MNT is unfreezed
xfs_freeze -u $SCRATCH_MNT 2>/dev/null
- $KILLALL_PROG -9 fsstress 2>/dev/null
- wait
+ _kill_fsstress
cd /
rm -f $tmp.*
}
_check_scratch_log_state
-$FSSTRESS_PROG -d $SCRATCH_MNT/fsstress -n 9999999 -p 2 -S t \
- >> $seqres.full 2>&1 &
+_run_fsstress_bg -d $SCRATCH_MNT/fsstress -n 9999999 -p 2 -S t
iters=5
while [ $iters -gt 0 ]; do
iters=$((iters - 1))
done
-$KILLALL_PROG $FSSTRESS_PROG
-wait
-
+_kill_fsstress
_scratch_unmount
status=0
# Import common functions.
. ./common/filter
-# Override the default cleanup function.
-_cleanup()
-{
- $KILLALL_PROG -9 fsstress 2>/dev/null
- wait
- cd /
- _scratch_unmount 2>/dev/null
- rm -f $tmp.*
-}
-
filter_enospc() {
sed -e '/^.*No space left on device.*/d'
}
_cleaner $SCRATCH_MNT $LOOPS $MINDIRS &
# start a background stress workload on the fs
-$FSSTRESS_PROG -d $SCRATCH_MNT/fsstress -n 9999999 -p 2 -S t \
- >> $seqres.full 2>&1 &
+_run_fsstress_bg -d $SCRATCH_MNT/fsstress -n 9999999 -p 2 -S t
# Each cycle clones the current directory and makes a random file replacement
# pass on the new directory. The directory is copied to the next using hard
_rand_replace $SCRATCH_MNT/dir$((i+1)) $COUNT
done
-$KILLALL_PROG fsstress
-wait
+_kill_fsstress
# clean out the competing fsstress allocations, then everything else
rm -rf $SCRATCH_MNT/fsstress
. ./common/preamble
_begin_fstest mount auto quick stress
-_register_cleanup "_cleanup; rm -f $tmp.*"
-
-# Override the default cleanup function.
-_cleanup()
-{
- echo "*** unmount"
- _scratch_unmount 2>/dev/null
-}
-
# Import common functions.
. ./common/filter
for l in 0 1 2 3 4
do
echo " *** test $l"
- FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -n 1000 $FSSTRESS_AVOID`
- $FSSTRESS_PROG $FSSTRESS_ARGS >>$seqres.full
+ FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -n 1000`
+ _run_fsstress $FSSTRESS_ARGS
_try_scratch_mount -o remount,ro \
|| _fail "remount ro failed"
*** test 3
*** test 4
*** done
-*** unmount
fi
_scratch_mount
# light population of the fs
- $FSSTRESS_PROG -n 100 -d $SCRATCH_MNT >> $seqres.full 2>&1
+ _run_fsstress -n 100 -d $SCRATCH_MNT
_scratch_unmount
# Test "duplicate" copy at first, if $XFS_COPY_PROG won't do it.
|| _fail "!!! failed to loop mount xfs"
_log "stress"
-$FSSTRESS_PROG -d $SCRATCH_MNT/test -n 1000 $FSSTRESS_AVOID >> $seqres.full 2>&1 \
+_run_fsstress -d $SCRATCH_MNT/test -n 1000 \
|| _fail "!!! stress failed"
_log "clean"
|| _fail "!!! failed to loop mount xfs"
_log "stress ext2 on xfs via loop"
-$FSSTRESS_PROG -d $SCRATCH_MNT/test2 -n 1000 $FSSTRESS_AVOID >> $seqres.full 2>&1 \
+_run_fsstress -d $SCRATCH_MNT/test2 -n 1000 \
|| _fail "!!! stress ext2 failed"
_log "clean"
. ./common/preamble
_begin_fstest shutdown auto log metadata
-# Override the default cleanup function.
-_cleanup()
-{
- cd /
- rm -f $tmp.*
- $KILLALL_PROG -9 $FSSTRESS_PROG > /dev/null 2>&1
- _scratch_unmount > /dev/null 2>&1
-}
-
# Import common functions.
. ./common/dmflakey
# Start a workload and shutdown the fs. The subsequent mount will require log
# recovery.
-$FSSTRESS_PROG -n 9999 -p 2 -w -d $SCRATCH_MNT &>> $seqres.full &
+_run_fsstress_bg -n 9999 -p 2 -w -d $SCRATCH_MNT
sleep 5
_scratch_shutdown -f
-$KILLALL_PROG -q $FSSTRESS_PROG
-wait
+_kill_fsstress
_scratch_unmount
# Initialize a dm-flakey device that will pass I/Os for 5s and fail thereafter.
# Override the default cleanup function.
_cleanup()
{
- cd /
- rm -f $tmp.*
- $KILLALL_PROG -9 fsstress > /dev/null 2>&1
[ -e /sys/fs/xfs/$sdev/errortag/log_item_pin ] &&
echo 0 > /sys/fs/xfs/$sdev/errortag/log_item_pin
+ _kill_fsstress
wait > /dev/null 2>&1
+ cd /
+ rm -f $tmp.*
}
# Import common functions.
_scratch_mount
# populate the fs with some data and cycle the mount to reset the log head/tail
-$FSSTRESS_PROG -d $SCRATCH_MNT -z -fcreat=1 -p 4 -n 100000 >> $seqres.full
+_run_fsstress -d $SCRATCH_MNT -z -fcreat=1 -p 4 -n 100000
_scratch_cycle_mount || _fail "cycle mount failed"
# Pin the tail and start a file removal workload. File removal tends to
_scratch_mount
# Put some stuff on the fs
-$FSSTRESS_PROG -d $SCRATCH_MNT -n 100 -p 4 >> $seqres.full 2>&1
+_run_fsstress -d $SCRATCH_MNT -n 100 -p 4
_scratch_unmount
# Can xfs_db change it?
. ./common/preamble
_begin_fstest shutdown auto log quick
-# Override the default cleanup function.
-_cleanup()
-{
- cd /
- rm -f $tmp.*
- $KILLALL_PROG -9 fsstress > /dev/null 2>&1
- wait > /dev/null 2>&1
-}
-
# Import common functions.
. ./common/log
-
# Modify as appropriate.
_require_scratch
_require_v2log
_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 &
+_run_fsstress_bg -d $SCRATCH_MNT -p 4 -n 99999999
sleep 10
_scratch_shutdown -f
-wait
+_wait_for_fsstress
# Remount with a different log buffer size. Going from 32k to 64k increases the
# log record extended header count, as the log record header can only handle 32k
procs=3
nops=1000
# -w ensures that the only ops are ones which cause write I/O
- FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -w -p $procs \
- -n $nops $FSSTRESS_AVOID`
- $FSSTRESS_PROG $FSSTRESS_ARGS >> $seqres.full 2>&1 &
+ args=`_scale_fsstress_args -d $SCRATCH_MNT -w -p $procs -n $nops`
+ _run_fsstress_bg $args
}
_require_scratch
break
done
-#
# Grow the filesystem while actively stressing it...
-# Kick off more stress threads on each iteration, grow; repeat.
-#
while [ $size -le $endsize ]; do
echo "*** stressing filesystem"
echo "*** stressing a ${sizeb} block filesystem" >> $seqres.full
- _stress_scratch
+ _stress_scratch
sleep 1
size=`expr $size + $incsize`
sizeb=`expr $size / $dbsize` # in data blocks
[ `expr $size % $modsize` -eq 0 ] && wait # every 4th iteration
echo AGCOUNT=$agcount | tee -a $seqres.full
echo && echo >> $seqres.full
+ _wait_for_fsstress
done
-wait # stop for any remaining stress processes
-
-_scratch_unmount
status=0
exit
# do some work on the fs to update metadata LSNs
_scratch_mount
-$FSSTRESS_PROG -d $SCRATCH_MNT -n 999 -p 4 -w >> $seqres.full 2>&1
+_run_fsstress -d $SCRATCH_MNT -n 999 -p 4 -w
_scratch_unmount
# Reformat to the current cycle and try to mount. This fails in most cases
. ./common/preamble
_begin_fstest auto log metadata
-# Override the default cleanup function.
-_cleanup()
-{
- cd /
- rm -f $tmp.*
- $KILLALL_PROG -9 fsstress > /dev/null 2>&1
- wait > /dev/null 2>&1
-}
-
# Import common functions.
. ./common/inject
-
# Modify as appropriate.
_require_xfs_io_error_injection "log_bad_crc"
_require_scratch
# Run fsstress until the filesystem shuts down. It will shut down
# automatically when error injection triggers.
- $FSSTRESS_PROG -d $SCRATCH_MNT -p 4 -n 999999 >> $seqres.full 2>&1
+ _run_fsstress -d $SCRATCH_MNT -p 4 -n 999999
# Verify that we can remount the fs. Log recovery should handle the torn
# write.
_scratch_mount
mkdir $SCRATCH_MNT/stress
-$FSSTRESS_PROG -d $SCRATCH_MNT/stress -n 1000 >> $seqres.full
+_run_fsstress -d $SCRATCH_MNT/stress -n 1000
echo moo > $SCRATCH_MNT/urk
_scratch_unmount
echo "Filesystem should be usable again"
_scratch_mount
-$FSSTRESS_PROG -d $SCRATCH_MNT/stress -n 1000 >> $seqres.full
+_run_fsstress -d $SCRATCH_MNT/stress -n 1000
_scratch_unmount
_check_scratch_fs
_check_scratch_xfs_features INOBTCNT
. ./common/preamble
_begin_fstest rw metadata auto stress prealloc
-# Override the default cleanup function.
-_cleanup()
-{
- $KILLALL_PROG -r -q -TERM fsstress 2> /dev/null
- wait # ensures all fsstress processes died
-}
-
workout()
{
procs=100
nops=15000
- FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -p $procs -n $nops \
- $FSSTRESS_AVOID`
- $FSSTRESS_PROG $FSSTRESS_ARGS >> $seqres.full &
+ FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -p $procs -n $nops`
+ _run_fsstress_bg $FSSTRESS_ARGS
sleep 2
}
workout
$TEST_PROG $LOOPS $TEST_FILE
+_kill_fsstress
+
echo " *** test done"
status=0
local procs=3
local nops=1000
# -w ensures that the only ops are ones which cause write I/O
- local FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -w \
- -p $procs -n $nops $FSSTRESS_AVOID`
- $FSSTRESS_PROG $FSSTRESS_ARGS >> $seqres.full 2>&1
+ local args=`_scale_fsstress_args -d $SCRATCH_MNT -w -p $procs -n $nops`
+ _run_fsstress_bg $args
}
_require_scratch_xfs_shrink
decsize=`expr 41 \* 1048576 + 1 + $RANDOM \* $RANDOM % 1048576`
while [ $size -gt $endsize ]; do
- stress_scratch &
+ stress_scratch
sleep 1
decb=`expr $decsize / $dbsize` # in data blocks
. $tmp.growfs
size=`expr $dblocks \* $dbsize`
+ _kill_fsstress
_scratch_unmount
_scratch_xfs_repair -n >> $seqres.full 2>&1 || \
_fail "xfs_repair failed with shrinking $sizeb"
# start a metadata-intensive workload, but no data allocation operation.
# Because uncompleted new space allocation I/Os may cause XFS to shutdown
# after loading error table.
- $FSSTRESS_PROG -z -n 5000 -p 10 \
+ _run_fsstress -z -n 5000 -p 10 \
-f creat=10 \
-f resvsp=1 \
-f truncate=1 \
-f unlink=1 \
-f symlink=1 \
-f rename=1 \
- -d $SCRATCH_MNT/fsstress >> $seqres.full 2>&1
+ -d $SCRATCH_MNT/fsstress
# Loading error table without "--nolockfs" option. Because "--nolockfs"
# won't freeze fs, then some running I/Os may cause XFS to shutdown
else
# no hang/panic is fine
cat $SCRATCH_MNT/testfile > /dev/null
- $FSSTRESS_PROG -d $SCRATCH_MNT -p 4 -n 400 >>$seqres.full 2>&1
+ _run_fsstress -d $SCRATCH_MNT -p 4 -n 400
fi
# remount as rw, kernel should reject it
{
# Make sure $SCRATCH_MNT is unfreezed
xfs_freeze -u $SCRATCH_MNT 2>/dev/null
- $KILLALL_PROG -q -9 $FSSTRESS_PROG
- wait
+ _kill_fsstress
cd /
rm -f $tmp.*
}
STRESS_DIR="$SCRATCH_MNT/testdir"
mkdir -p $STRESS_DIR
-$FSSTRESS_PROG -d $STRESS_DIR -n 100 -p 1000 $FSSTRESS_AVOID >>$seqres.full &
+_run_fsstress_bg -d $STRESS_DIR -n 1000 -p 1000 $FSSTRESS_AVOID
# Freeze/unfreeze file system randomly
echo "Start freeze/unfreeze randomly" | tee -a $seqres.full
let LOOP=$LOOP-1
done
echo "Test done" | tee -a $seqres.full
-$KILLALL_PROG -q $FSSTRESS_PROG
-wait
+_kill_fsstress
status=0
exit
#
# FS QA Test No. 305
#
-# Test to verify that turn group/project quotas off while fstress and
+# Test to verify that turn group/project quotas off while fsstress and
# user quotas are left on.
#
. ./common/preamble
_require_scratch
_require_xfs_quota
-_require_command "$KILLALL_PROG" killall
_scratch_mkfs_xfs -m crc=1 >/dev/null 2>&1
_qmount
mkdir -p $QUOTA_DIR
- $FSSTRESS_PROG -d $QUOTA_DIR -n 1000000 -p 100 $FSSTRESS_AVOID >>$seqres.full &
+ _run_fsstress_bg -d $QUOTA_DIR -n 1000000 -p 100
sleep 10
$XFS_QUOTA_PROG -x -c "disable -$type" $SCRATCH_DEV
sleep 5
- $KILLALL_PROG -q $FSSTRESS_PROG
- wait
+ _kill_fsstress
}
echo "*** turn off group quotas"
. ./common/preamble
_begin_fstest auto stress clone quota
-# Override the default cleanup function.
-_cleanup()
-{
- cd /
- rm -f $tmp.*
- $KILLALL_PROG -9 fsstress > /dev/null 2>&1
-}
-
# Import common functions.
. ./common/quota
. ./common/filter
nr_cpus=$((LOAD_FACTOR * 4))
nr_ops=$((25000 * nr_cpus * TIME_FACTOR))
-$FSSTRESS_PROG $FSSTRESS_AVOID -w -d $SCRATCH_MNT -n $nr_ops -p $nr_cpus >> $seqres.full
+_run_fsstress -w -d $SCRATCH_MNT -n $nr_ops -p $nr_cpus
echo "Check quota before remount"
check_quota_du_blocks
_scratch_inject_error bmap_alloc_minlen_extent 1
echo "Execute fsstress"
-$FSSTRESS_PROG -d $SCRATCH_MNT \
+_run_fsstress -d $SCRATCH_MNT \
$(_scale_fsstress_args -p 75 -n 1000) \
-f bulkstat=0 \
-f bulkstat1=0 \
-f readv=0 \
-f stat=0 \
-f aread=0 \
- -f dread=0 >> $seqres.full
+ -f dread=0
# success, all done
status=0
nops=999999
# -w ensures that the only ops are ones which cause write I/O
FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -w -p $procs \
- -n $nops $FSSTRESS_AVOID`
- $FSSTRESS_PROG $FSSTRESS_ARGS >> $seqres.full 2>&1 &
+ -n $nops`
+ _run_fsstress_bg $FSSTRESS_ARGS >> $seqres.full 2>&1
}
_require_scratch
_require_command "$XFS_GROWFS_PROG" xfs_growfs
-_require_command "$KILLALL_PROG" killall
-
-_cleanup()
-{
- $KILLALL_ALL fsstress > /dev/null 2>&1
- wait
- cd /
- rm -f $tmp.*
-}
_scratch_mkfs_xfs | _filter_mkfs >$seqres.full 2>$tmp.mkfs
. $tmp.mkfs # extract blocksize and data size for scratch device
sleep $((RANDOM % 3))
_scratch_shutdown
- ps -e | grep fsstress > /dev/null 2>&1
- while [ $? -eq 0 ]; do
- $KILLALL_PROG -9 fsstress > /dev/null 2>&1
- wait > /dev/null 2>&1
- ps -e | grep fsstress > /dev/null 2>&1
- done
+ _kill_fsstress
_scratch_cycle_mount
done > /dev/null 2>&1
wait # stop for any remaining stress processes
nops=999999
# -w ensures that the only ops are ones which cause write I/O
FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -w -p $procs \
- -n $nops $FSSTRESS_AVOID`
- $FSSTRESS_PROG $FSSTRESS_ARGS >> $seqres.full 2>&1 &
+ -n $nops`
+ _run_fsstress_bg $FSSTRESS_ARGS >> $seqres.full 2>&1
}
_require_scratch
_require_realtime
_require_command "$XFS_GROWFS_PROG" xfs_growfs
-_require_command "$KILLALL_PROG" killall
-
-_cleanup()
-{
- $KILLALL_ALL fsstress > /dev/null 2>&1
- wait
- cd /
- rm -f $tmp.*
-}
_scratch_mkfs_xfs | _filter_mkfs >$seqres.full 2>$tmp.mkfs
. $tmp.mkfs # extract blocksize and data size for scratch device
sleep $((RANDOM % 3))
_scratch_shutdown
- ps -e | grep fsstress > /dev/null 2>&1
- while [ $? -eq 0 ]; do
- $KILLALL_PROG -9 fsstress > /dev/null 2>&1
- wait > /dev/null 2>&1
- ps -e | grep fsstress > /dev/null 2>&1
- done
+ _kill_fsstress
_scratch_cycle_mount
done > /dev/null 2>&1
wait # stop for any remaining stress processes