export ATTR_PROG="$(type -P attr)"
export QUOTA_PROG="$(type -P quota)"
export XFS_QUOTA_PROG="$(type -P xfs_quota)"
-export KILLALL_PROG="$(type -P killall)"
export INDENT_PROG="$(type -P indent)"
export XFS_COPY_PROG="$(type -P xfs_copy)"
export FSTRIM_PROG="$(type -P fstrim)"
# a race condition that can hang fstests.
#
# If the xfs_io -c freeze process is asleep waiting for a write lock on
- # s_umount or sb_write when the killall signal is delivered, it will
+ # s_umount or sb_write when the kill signal is delivered, it will
# not check for pending signals until after it has frozen the fs. If
# even one thread of the stress test processes (xfs_io, fsstress, etc.)
- # is waiting for read locks on sb_write when the killall signals are
+ # is waiting for read locks on sb_write when the kill signals are
# delivered, they will block in the kernel until someone thaws the fs,
# and the `wait' below will wait forever.
#
- # Hence we issue the killall, wait for the freezer loop to exit, thaw
+ # Hence we issue the kill, wait for the freezer loop to exit, thaw
# the filesystem, and wait for the rest of the children.
if [ -n "$__SCRUB_STRESS_FREEZE_PID" ]; then
echo "Waiting for fs freezer $__SCRUB_STRESS_FREEZE_PID to exit at $(date)" >> $seqres.full
should then be used to refer to the command when executing it. For
example:
- _require_command "KILLALL_PROG" killall
+ _require_command "$XFS_DB_PROG" "xfs_db"
- to locate the killall command and then:
+ to locate the xfs_db command and then:
- $KILLALL_PROG -q $FSSTRESS_PROG
+ $XFS_DB_PROG -c "sb 0" -c "print" $SCRATCH_DEV
to make use of it.
. ./common/dmlogwrites
-_require_command "$KILLALL_PROG" killall
_require_command "$BLKDISCARD_PROG" blkdiscard
_require_btrfs_fs_feature "no_holes"
_require_btrfs_mkfs_feature "no-holes"
. ./common/filter
_require_scratch
-_require_command "$KILLALL_PROG" killall
-
_scratch_mkfs >> $seqres.full
_scratch_mount
_require_quota
_require_user
_require_scratch
-_require_command "$KILLALL_PROG" killall
_require_command "$SETCAP_PROG" setcap
_require_attrs security
# Override the default cleanup function.
_cleanup()
{
+ if [ -n "$readdir_pid" ]; then
+ pkill --parent "$readdir_pid" t_readdir > /dev/null 2>&1
+ kill -9 $readdir_pid > /dev/null 2>&1
+ wait
+ fi
rm -rf $TEST_DIR/tmp
+ rm -f $tmp.*
}
# Import common functions.
. ./common/filter
_require_test
-_require_command "$KILLALL_PROG" killall
dmesg -c > /dev/null
_test_read()
{
- $here/src/t_readdir_1 $SEQ_DIR &
+ $here/src/t_readdir_1 $SEQ_DIR > /dev/null 2>&1 &
+ readdir_pid=$!
sleep $RUN_TIME
- $KILLALL_PROG t_readdir_1
+ kill $readdir_pid
+ unset readdir_pid
+ wait
check_kernel_bug
if [ $? -ne 0 ]; then
_fatal "kernel bug detected, check dmesg for more infomation."
_test_lseek()
{
- $here/src/t_readdir_2 $SEQ_DIR &
+ $here/src/t_readdir_2 $SEQ_DIR > /dev/null 2>&1 &
+ readdir_pid=$!
sleep $RUN_TIME
- $KILLALL_PROG t_readdir_2
+ kill $readdir_pid
+ unset readdir_pid
+ wait
+
check_kernel_bug
if [ $? -ne 0 ]; then
_fatal "kernel bug detected, check dmesg for more infomation."
_require_test
_require_scratch
_require_split_huge_pages_knob
-_require_command "$KILLALL_PROG" "killall"
_fixed_by_git_commit kernel 2a0774c2886d \
"XArray: set the marks correctly when splitting an entry"
# Override the default cleanup function.
_cleanup()
{
- $KILLALL_PROG -9 open_by_handle >/dev/null 2>&1
- wait
+ if [ -n "$pids" ]; then
+ kill -9 $pids >/dev/null 2>&1
+ wait
+ fi
cd /
rm -f $tmp.*
}
# We need to require all features together, because nfs_export cannot
# be enabled when index is disabled
_require_scratch_overlay_features index nfs_export
-_require_command "$KILLALL_PROG" killall
# All overlay dirs are on scratch partition
lower=$OVL_BASE_SCRATCH_MNT/$OVL_LOWER
# overlay dentries in cache
_scratch_cycle_mount "index=on,nfs_export=on"
test_file_handles $SCRATCH_MNT -rnps -i $tmp.upper_file_handles &
+pids=$!
# Give the above 1 second to get to sleep loop
sleep 1
test_file_handles $SCRATCH_MNT -rnps -i $tmp.lower_file_handles &
+pids="$pids $!"
# Give the above 1 second to get to sleep loop
sleep 1
test_file_handles $SCRATCH_MNT -rnp -i $tmp.lower_file_handles
# SIGPIPE avoids Terminated/Killed message from bash
-$KILLALL_PROG -q -13 open_by_handle
+kill -13 $pids > /dev/null 2>&1
wait
+unset pids
status=0
exit
_require_scratch
_require_freeze
_require_xfs_sysfs $(_short_dev $TEST_DEV)/log
-_require_command "$KILLALL_PROG" killall
. ./common/filter
_require_scratch
_require_xfs_mkfs_finobt
_require_xfs_finobt
-_require_command "$KILLALL_PROG" killall
_scratch_mkfs_xfs "-m crc=1,finobt=1 -d agcount=2" | \
_filter_mkfs 2>> $seqres.full
_require_scratch
_require_dm_target flakey
_require_xfs_sysfs debug/log_recovery_delay
-_require_command "$KILLALL_PROG" killall
echo "Silence is golden."
_require_xfs_io_error_injection log_item_pin
_require_xfs_io_error_injection log_bad_crc
_require_scratch
-_require_command "$KILLALL_PROG" killall
echo "Silence is golden."
# Override the default cleanup function.
_cleanup()
{
+ [ -n "$repair_pid" ] && kill -9 $repair_pid > /dev/null 2>&1
+ wait > /dev/null 2>&1
cd /
rm -f $tmp.*
- $KILLALL_PROG -9 $XFS_REPAIR_PROG > /dev/null 2>&1
- wait > /dev/null 2>&1
}
# Start and monitor an xfs_repair of the scratch device. This test can induce a
repair_pid=$!
# monitor progress for as long as it is running
- while [ `pgrep xfs_repair` ]; do
+ running=`pgrep xfs_repair`
+ while [ -n "$running" ]; do
grep "couldn't verify primary superblock" $tmp.repair \
> /dev/null 2>&1
if [ $? == 0 ]; then
fi
sleep 1
+ running=`pgrep xfs_repair`
done
wait
# Modify as appropriate.
_require_scratch_nocheck
-_require_command "$KILLALL_PROG" killall
_scratch_mkfs | _filter_mkfs > /dev/null 2> $tmp.mkfs
# Modify as appropriate.
_require_scratch
_require_v2log
-_require_command "$KILLALL_PROG" killall
echo "Silence is golden."
# Modify as appropriate.
_require_xfs_io_error_injection "log_bad_crc"
_require_scratch
-_require_command "$KILLALL_PROG" killall
echo "Silence is golden."
# Import common functions.
. ./common/filter
-
-_require_command "$KILLALL_PROG" killall
_require_xfs_io_command "falloc"
-
_require_scratch
_scratch_mkfs_xfs >/dev/null 2>&1
_scratch_mount
# Import common functions.
. ./common/filter
-
_require_scratch
_require_freeze
-_require_command "$KILLALL_PROG" killall
logblks=$(_scratch_find_xfs_min_logblocks -d agcount=16,su=256k,sw=12 -l su=256k)
_scratch_mkfs_xfs -d agcount=16,su=256k,sw=12 -l su=256k,size=${logblks}b >/dev/null 2>&1
_require_scratch_reflink
_require_quota
-_require_command "$KILLALL_PROG" "killall"
report_quota_blocks() {
$XFS_QUOTA_PROG -x -c "report $1" $SCRATCH_MNT | \