@@ -29,11 +29,8 @@ _begin_fstest auto
# 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
+ pkill -9 $seq.t_readdir > /dev/null 2>&1
+ wait
rm -rf $TEST_DIR/tmp
rm -f $tmp.*
}
@@ -74,6 +71,8 @@ check_kernel_bug()
RUN_TIME=$((30 * $TIME_FACTOR))
+cp $here/src/t_readdir_1 $TEST_DIR/$seq.t_readdir_1
+cp $here/src/t_readdir_2 $TEST_DIR/$seq.t_readdir_2
SEQ_DIR=$TEST_DIR/$seq
mkdir -p $SEQ_DIR
for n in {1..4096}; do
@@ -82,12 +81,11 @@ done
_test_read()
{
- $here/src/t_readdir_1 $SEQ_DIR > /dev/null 2>&1 &
- readdir_pid=$!
+ $TEST_DIR/$seq.t_readdir_1 $SEQ_DIR > /dev/null 2>&1 &
sleep $RUN_TIME
- kill $readdir_pid
- unset readdir_pid
+ pkill -PIPE $seq.t_readdir_1
wait
+
check_kernel_bug
if [ $? -ne 0 ]; then
_fatal "kernel bug detected, check dmesg for more infomation."
@@ -96,11 +94,10 @@ _test_read()
_test_lseek()
{
- $here/src/t_readdir_2 $SEQ_DIR > /dev/null 2>&1 &
+ $TEST_DIR/$seq.t_readdir_2 $SEQ_DIR > /dev/null 2>&1 &
readdir_pid=$!
sleep $RUN_TIME
- kill $readdir_pid
- unset readdir_pid
+ pkill -PIPE $seq.t_readdir_2
wait
check_kernel_bug