]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
fuzzy: don't use killall
authorDave Chinner <dchinner@redhat.com>
Tue, 26 Nov 2024 20:41:30 +0000 (07:41 +1100)
committerZorro Lang <zlang@kernel.org>
Sun, 8 Dec 2024 13:59:47 +0000 (21:59 +0800)
Having test cleanup call 'killall xfs_io fsx xfs_scrub' results in a
system wide process kill, rather than just the processes the test is
running directly.

Make sure we only kill processes the fuzz test directly owns. We can
do this with 'pkill --parent $$ <process names>' to limit the search
for processes to kill to just the children of the current process.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Zorro lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/fuzzy

index 9181520a3054fe4bcb431f1bfeeedc95d926d73c..3a7f04aaebe0d8a5c8d982b056ca6fa7de563c4b 100644 (file)
@@ -1145,7 +1145,6 @@ __stress_scrub_fsstress_loop() {
 _require_xfs_stress_scrub() {
        _require_xfs_io_command "scrub"
        _require_test_program "xfsfind"
-       _require_command "$KILLALL_PROG" killall
        _require_freeze
        command -v _filter_scratch &>/dev/null || \
                _notrun 'xfs scrub stress test requires common/filter'
@@ -1178,7 +1177,9 @@ _scratch_xfs_stress_scrub_cleanup() {
        # distorts the golden output.
        echo "Killing stressor processes at $(date)" >> $seqres.full
        _kill_fsstress
-       $KILLALL_PROG -INT xfs_io fsx xfs_scrub >> $seqres.full 2>&1
+       pkill -INT --parent $$ xfs_io >> $seqres.full 2>&1
+       pkill -INT --parent $$ fsx >> $seqres.full 2>&1
+       pkill -INT --parent $$ 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