]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commit
btrfs: add helper to kill background process running _btrfs_stress_remount_compress
authorFilipe Manana <fdmanana@suse.com>
Wed, 27 Mar 2024 17:11:40 +0000 (17:11 +0000)
committerAnand Jain <anand.jain@oracle.com>
Wed, 3 Apr 2024 07:08:30 +0000 (15:08 +0800)
commit058e46de642cee991d01de776639bb094ffcdcc3
tree00a040e1f9c3b4be9bda0187416e5e6cd3e78fa6
parentd6b4a1531fbb15dee7db86272eabe4fd86c49465
btrfs: add helper to kill background process running _btrfs_stress_remount_compress

Killing a background process running _btrfs_stress_remount_compress() 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 "mount.*$SCRATCH_MNT" | 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>
[ Restore 'wait $fsstress_pid' before 'kill $replace_pid' ]
common/btrfs
tests/btrfs/063
tests/btrfs/068
tests/btrfs/071
tests/btrfs/073
tests/btrfs/074