diff mbox series

[v4,6/6] btrfs: skip squota incompatible tests

Message ID 32ac4b162efb7356eb02398446f9cc082344436f.1695942727.git.boris@bur.io (mailing list archive)
State New, archived
Headers show
Series btrfs: simple quotas fstests | expand

Commit Message

Boris Burkov Sept. 28, 2023, 11:16 p.m. UTC
These tests cannot succeed if mkfs enable squotas, as they either test
the specifics of qgroups behavior or they test *enabling* squotas. Skip
these in squota mode.

Signed-off-by: Boris Burkov <boris@bur.io>
---
 tests/btrfs/017 | 1 +
 tests/btrfs/057 | 1 +
 tests/btrfs/091 | 3 ++-
 3 files changed, 4 insertions(+), 1 deletion(-)

Comments

Anand Jain Sept. 29, 2023, 9:37 a.m. UTC | #1
> 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
Anand Jain Sept. 29, 2023, 9:42 a.m. UTC | #2
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)
Boris Burkov Sept. 29, 2023, 4:57 p.m. UTC | #3
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)
> 
> 
> 

Oh, interesting. I am using BTRFS_UTIL_PROG to run a relatively new
local-built progs in my test setup and it looks like that only prints
the quota rescan message with -v passed in, while my system default
btrfs prints it without -v. I'll make sure the test passes with that
BTRFS_UTIL_PROG as well.

Thanks for the catch and all the other review!

Just to make sure, you would like this last fix as a separate patch or
should I resend?
Boris Burkov Sept. 29, 2023, 5:28 p.m. UTC | #4
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.
diff mbox series

Patch

diff --git a/tests/btrfs/017 b/tests/btrfs/017
index 622071018..496cc7df1 100755
--- a/tests/btrfs/017
+++ b/tests/btrfs/017
@@ -22,6 +22,7 @@  _begin_fstest auto quick qgroup
 
 _supported_fs btrfs
 _require_scratch
+_require_scratch_qgroup
 _require_cloner
 
 # Currently in btrfs the node/leaf size can not be smaller than the page
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
 
diff --git a/tests/btrfs/091 b/tests/btrfs/091
index f2cd00b2e..a71e03406 100755
--- a/tests/btrfs/091
+++ b/tests/btrfs/091
@@ -19,6 +19,7 @@  _begin_fstest auto quick qgroup
 _supported_fs btrfs
 _require_scratch
 _require_cp_reflink
+_require_scratch_qgroup
 
 # use largest node/leaf size (64K) to allow the test to be run on arch with
 # page size > 4k.
@@ -35,7 +36,7 @@  _run_btrfs_util_prog subvolume create $SCRATCH_MNT/subv2
 _run_btrfs_util_prog subvolume create $SCRATCH_MNT/subv3
 
 _run_btrfs_util_prog quota enable $SCRATCH_MNT
-_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT
+_qgroup_rescan $SCRATCH_MNT
 
 $XFS_IO_PROG -f -c "pwrite 0 256K" $SCRATCH_MNT/subv1/file1 | _filter_xfs_io
 cp --reflink $SCRATCH_MNT/subv1/file1 $SCRATCH_MNT/subv2/file1