All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Dave Chinner <david@fromorbit.com>
Cc: guaneryu@gmail.com, zlang@redhat.com, linux-xfs@vger.kernel.org,
	fstests@vger.kernel.org, guan@eryu.me
Subject: Re: [PATCH] xfs/432: fix this test when external devices are in use
Date: Wed, 27 Jul 2022 16:15:30 -0700	[thread overview]
Message-ID: <YuHHEhE1Hw6nL6Y+@magnolia> (raw)
In-Reply-To: <YuHAnCoB4FvMvIzb@magnolia>

On Wed, Jul 27, 2022 at 03:47:56PM -0700, Darrick J. Wong wrote:
> On Thu, Jul 28, 2022 at 08:06:00AM +1000, Dave Chinner wrote:
> > On Tue, Jul 26, 2022 at 12:51:31PM -0700, Darrick J. Wong wrote:
> > > From: Darrick J. Wong <djwong@kernel.org>
> > > 
> > > This program exercises metadump and mdrestore being run against the
> > > scratch device.  Therefore, the test must pass external log / rt device
> > > arguments to xfs_repair -n to check the "restored" filesystem.  Fix the
> > > incorrect usage, and report repair failures, since this test has been
> > > silently failing for a while now.
> > > 
> > > Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> > > ---
> > >  tests/xfs/432 |   11 ++++++++++-
> > >  1 file changed, 10 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/tests/xfs/432 b/tests/xfs/432
> > > index 86012f0b..5c6744ce 100755
> > > --- a/tests/xfs/432
> > > +++ b/tests/xfs/432
> > > @@ -89,7 +89,16 @@ _scratch_xfs_metadump $metadump_file -w
> > >  xfs_mdrestore $metadump_file $metadump_img
> > >  
> > >  echo "Check restored metadump image"
> > > -$XFS_REPAIR_PROG -n $metadump_img >> $seqres.full 2>&1
> > > +repair_args=('-n')
> > > +[ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
> > > +	repair_args+=('-l' "$SCRATCH_LOGDEV")
> > > +
> > > +[ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_RTDEV" ] && \
> > > +	repair_args+=('-r' "$SCRATCH_RTDEV")
> > > +
> > > +$XFS_REPAIR_PROG "${repair_args[@]}" $metadump_img >> $seqres.full 2>&1
> > > +res=$?
> > > +test $res -ne 0 && echo "xfs_repair on restored fs returned $res?"
> > 
> > I don't like open coding external device support into individual
> > tests.
> > 
> > i.e. Shouldn't this use a wrapper around check_xfs_filesystem()
> > similar to _check_xfs_test_fs()? Call it check_xfs_scratch_fs() that
> > uses SCRATCH_DEV by default, but if $1 is passed in use that as the
> > scratch device instead?
> 
> Yeah, that would also work.  IIRC there's one other fstest that does
> something similar to this.

Actually, there already is a _scratch_xfs_repair, so I think I'll just
re(ab)use it:

SCRATCH_DEV=$metadump_img _scratch_xfs_repair -n &>> $seqres.full || \
	echo "xfs_repair on restored fs returned $?"

--D

> --D
> 
> > Cheers,
> > 
> > Dave.
> > -- 
> > Dave Chinner
> > david@fromorbit.com

      reply	other threads:[~2022-07-27 23:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-26 19:51 [PATCH] xfs/432: fix this test when external devices are in use Darrick J. Wong
2022-07-27 12:21 ` Zorro Lang
2022-07-27 14:59   ` Darrick J. Wong
2022-07-27 17:21     ` Zorro Lang
2022-07-27 23:14       ` [PATCH] xfs/432: fix this test when external devices are in useOM Darrick J. Wong
2022-07-27 22:06 ` [PATCH] xfs/432: fix this test when external devices are in use Dave Chinner
2022-07-27 22:47   ` Darrick J. Wong
2022-07-27 23:15     ` Darrick J. Wong [this message]

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=YuHHEhE1Hw6nL6Y+@magnolia \
    --to=djwong@kernel.org \
    --cc=david@fromorbit.com \
    --cc=fstests@vger.kernel.org \
    --cc=guan@eryu.me \
    --cc=guaneryu@gmail.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=zlang@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.