linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Boris Burkov <boris@bur.io>
To: Anand Jain <anand.jain@oracle.com>
Cc: linux-btrfs@vger.kernel.org, kernel-team@fb.com, fstests@vger.kernel.org
Subject: Re: [PATCH v4 6/6] btrfs: skip squota incompatible tests
Date: Fri, 29 Sep 2023 10:28:50 -0700	[thread overview]
Message-ID: <20230929172850.GA2503006@zen.localdomain> (raw)
In-Reply-To: <9d06f5aa-9124-d3ed-5585-0c42988e155c@oracle.com>

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.

  parent reply	other threads:[~2023-09-29 17:28 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-28 23:16 [PATCH v4 0/6] btrfs: simple quotas fstests Boris Burkov
2023-09-28 23:16 ` [PATCH v4 1/6] common: refactor sysfs_attr functions Boris Burkov
2023-09-29  8:23   ` Anand Jain
2023-09-28 23:16 ` [PATCH v4 2/6] btrfs: quota mode helpers Boris Burkov
2023-09-29  8:57   ` Anand Jain
2023-09-29  9:11     ` Anand Jain
2023-09-28 23:16 ` [PATCH v4 3/6] btrfs/301: new test for simple quotas Boris Burkov
2023-09-28 23:16 ` [PATCH v4 4/6] btrfs: quota rescan helpers Boris Burkov
2023-09-29  9:14   ` Anand Jain
2023-09-28 23:16 ` [PATCH v4 5/6] btrfs: use new rescan wrapper Boris Burkov
2023-09-29  9:28   ` Anand Jain
2023-09-28 23:16 ` [PATCH v4 6/6] btrfs: skip squota incompatible tests Boris Burkov
2023-09-29  9:37   ` Anand Jain
2023-09-29  9:42     ` Anand Jain
2023-09-29 16:57       ` Boris Burkov
2023-09-29 17:28       ` Boris Burkov [this message]
2023-09-29 17:43     ` [PATCH] btrfs: fix rescan helper Boris Burkov
2023-09-30  9:37       ` Anand Jain
2023-09-30  9:45 ` [PATCH v4 0/6] btrfs: simple quotas fstests Anand Jain
2023-10-05  8:08   ` Anand Jain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230929172850.GA2503006@zen.localdomain \
    --to=boris@bur.io \
    --cc=anand.jain@oracle.com \
    --cc=fstests@vger.kernel.org \
    --cc=kernel-team@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).