Re: [PATCH 06/10] btrfs: add helper to kill background process running _btrfs_stress_remount_compress

Filipe Manana
2024-03-28T12:04:01Z

On Thu, Mar 28, 2024 at 11:46 AM Anand Jain <anand.jain@oracle.com> wrote:
>
>
> >> diff --git a/tests/btrfs/071 b/tests/btrfs/071
> >> index 6ebbd8cc..7ba15390 100755
> >> --- a/tests/btrfs/071
> >> +++ b/tests/btrfs/071
> >> @@ -58,17 +58,15 @@ run_test()
> >> echo "$remount_pid" >>$seqres.full
>
>
>
> >> echo "Wait for fsstress to exit and kill all background workers"
> >> >>$seqres.full
> >> - wait $fsstress_pid
> >> - kill $replace_pid $remount_pid
> >> - wait
> >> + kill $replace_pid
> >> + wait $fsstress_pid $replace_pid
>
> The change first kills the replace and then wait for fsstress. Was this
> intentional?

It wasn't. But after all patches applied, everything's correct, we
wait for fsstress to finish and then kill replace.
Do you want me to fix that?

The sequence will have to be:

wait $fsstress_pid
kill $replace_pid
wait $replace_pid

Thanks.

>
> This patch is causing a regression. The replace never gets killed, as
> the echo-comment specifically states to wait for fsstress and then kill
> the replace. Following it fixes the issue.
>
> Which the patch 7/10 reversed the order to fix. But why?
>
> Thanks, Anand
>
>
> >> - # wait for the remount and replace operations to finish
> >> + # wait for the replace operationss to finish
>
>
>
>
> >> while ps aux | grep "replace start" | grep -qv grep; do
> >> sleep 1
> >> done
> >> - while ps aux | grep "mount.*$SCRATCH_MNT" | grep -qv grep; do
> >> - sleep 1
> >> - done
> >> +
> >> + _btrfs_kill_stress_remount_compress_pid $remount_pid $SCRATCH_MNT
> >> echo "Scrub the filesystem" >>$seqres.full
> >> $BTRFS_UTIL_PROG scrub start -B $SCRATCH_MNT >>$seqres.full 2>&1