On Fri, Sep 29, 2023 at 05:42:03PM +0800, Anand Jain wrote: > On 29/09/2023 17:37, Anand Jain wrote: > > > > > diff --git a/tests/btrfs/057 b/tests/btrfs/057 > > > index 782d854a0..e932a6572 100755 > > > --- a/tests/btrfs/057 > > > +++ b/tests/btrfs/057 > > > @@ -15,6 +15,7 @@ _begin_fstest auto quick > > > # real QA test starts here > > > _supported_fs btrfs > > > _require_scratch > > > +_require_qgroup_rescan > > > _scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full 2>&1 > > > > It appears that there is an issue with rescan's stdout and stderr , > > causing the failure. Please consider sending a fixup which apply > > on top of this. > > > > > > btrfs/057 4s ... - output mismatch (see > > /xfstests-dev/results//btrfs/057.out.bad) > > --- tests/btrfs/057.out 2023-02-20 12:32:31.399005973 +0800 > > +++ /xfstests-dev/results//btrfs/057.out.bad 2023-09-29 > > 17:31:24.462334654 +0800 > > @@ -1,2 +1,3 @@ > > QA output created by 057 > > +quota rescan started > > Silence is golden > > ... > > (Run 'diff -u /xfstests-dev/tests/btrfs/057.out > > /xfstests-dev/results//btrfs/057.out.bad' to see the entire diff) > > > > Thanks, Anand > > And btrfs/022 as well. > > btrfs/022 3s ... - output mismatch (see > /xfstests-dev/results//btrfs/022.out.bad) > --- tests/btrfs/022.out 2023-02-20 12:32:31.394980330 +0800 > +++ /xfstests-dev/results//btrfs/022.out.bad 2023-09-29 > 17:41:18.393742664 +0800 > @@ -1,2 +1,3 @@ > QA output created by 022 > +quota rescan started > Silence is golden > ... > (Run 'diff -u /xfstests-dev/tests/btrfs/022.out > /xfstests-dev/results//btrfs/022.out.bad' to see the entire diff) > > > Actually, my previous analysis about btrfs-progs was incorrect, the issue is more subtle, and has to do with the behavior of rescan -w. TL;DR: btrfs-progs is racily swallowing that output so my setup happens to not see it. We want to redirect it to fix it. More detail: In the new require_qgroup_rescan helper, we call quota rescan -w right after quota enable, which will also trigger a rescan. That rescan -w can hit EINPROGRESS which causes it to 1. not print "quota rescan started" and 2. since wait_for_completion=true, it swallows that particular error and issues the rescan wait ioctl which succeeds. Based on the doc, I am assuming that is the intentional behavior of the util, so we need to handle the variable output in fstests. The other rescan callers use the checked helper, which redirects the output, but since this callsite wants _notrun instead of _fail, it doesn't redirect, so if we race in the way that actually starts a new rescan, we get the message.