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

Anand Jain
2024-03-28T11:46:38Z

>> 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?

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