]> www.infradead.org Git - users/hch/xfstests-dev.git/commit
btrfs: add helper to kill background process running _btrfs_stress_scrub
authorFilipe Manana <fdmanana@suse.com>
Wed, 27 Mar 2024 17:11:38 +0000 (17:11 +0000)
committerAnand Jain <anand.jain@oracle.com>
Wed, 3 Apr 2024 07:08:15 +0000 (15:08 +0800)
commitb2a3bc018fe0e23c2fbd9df89353ca048b28ad73
tree1f3db5bc89d344737874ccacf04ff4ea6f28cc20
parent011174eab1c2059e657a12f69ce6bdb4b19db4ba
btrfs: add helper to kill background process running _btrfs_stress_scrub

Killing a background process running _btrfs_stress_scrub() is not as
simple as sending a signal to the process and waiting for it to die.
Therefore we have the following logic to terminate such process:

   kill $pid
   wait $pid
   while ps aux | grep "scrub start" | grep -qv grep; do
       sleep 1
   done

Since this is repeated in several test cases, move this logic to a common
helper and use it in all affected test cases. This will help to avoid
repeating the same code again several times in upcoming changes.

Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Anand Jain <anand.jain@oracle.com>
common/btrfs
tests/btrfs/061
tests/btrfs/066
tests/btrfs/069
tests/btrfs/072
tests/btrfs/073