FS/XFS testing framework
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: "Darrick J. Wong" <djwong@kernel.org>, fstests@vger.kernel.org
Subject: Re: [PATCH v2] xfs: test xfsdump when an inode < root inode is present
Date: Mon, 11 Apr 2022 15:31:35 +1000	[thread overview]
Message-ID: <20220411053135.GH1609613@dread.disaster.area> (raw)
In-Reply-To: <20220410121103.wk2hgixq57dogzah@zlang-mailbox>

On Sun, Apr 10, 2022 at 08:11:03PM +0800, Zorro Lang wrote:
> On Fri, Apr 08, 2022 at 09:00:56PM -0700, Darrick J. Wong wrote:
> > On Sat, Apr 09, 2022 at 01:08:47AM +0800, Zorro Lang wrote:
> > > From: Eric Sandeen <sandeen@redhat.com>
> > > 
> > > This tests a longstanding bug where xfsdumps are not properly
> > > created when an inode is present on the filesytsem which has
> > > a lower number than the root inode.
> > > 
> > > Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> > > Signed-off-by: Zorro Lang <zlang@redhat.com>
> > > ---
> > > 
> > > Friendly ping for reviewing.
> > > 
> > > Thanks,
> > > Zorro
> > > 
> > >  common/dump       |  1 +
> > >  tests/xfs/543     | 63 +++++++++++++++++++++++++++++++++++++++++++++++
> > >  tests/xfs/543.out | 47 +++++++++++++++++++++++++++++++++++
> > >  3 files changed, 111 insertions(+)
> > >  create mode 100755 tests/xfs/543
> > >  create mode 100644 tests/xfs/543.out
> > > 
> > > diff --git a/common/dump b/common/dump
> > > index ea16d442..ab48cd13 100644
> > > --- a/common/dump
> > > +++ b/common/dump
> > > @@ -219,6 +219,7 @@ _require_tape()
> > >  
> > >  _wipe_fs()
> > >  {
> > > +    [[ "$WIPE_FS" = "no" ]] && return
> > 
> > Is WIPE_FS intended as a general means to prevent wipefs -a between
> > tests?  If so, it ought to be in the README.
> 
> Actually I don't know how to if I should say WIPE_FS means to prevent
> wipefs -a between tests. Due to:
> 
> 1) We have a _wipe_fs() in common/dump[1], it's very old, and it only
> try to make a new xfs, although it calls wipe "fs"... And it's only used
> for tests/xfs/* cases to call _create_dumpdir_*() function.
> 
> 2) Then we have _try_wipe_scratch_devs() in common/rc [2], which calls
> _try_wipe_scratch_xfs() in common/xfs [3] (which is newer), it's only
> used in ./check script now.
> 
> So I'm wondering if we'd better to change the _wipe_fs() to:
> _wipe_dump()
> {
> 	[[ "$WIPE_DUMP" = "no" ]] && return
> 	_require_scratch
> 
> 	_try_wipe_scratch_devs >>$seqres.full
> 	_scratch_mount >>$seqres.full
> }
> 
> What do you think?

common/dump::_wipe_fs() is effectively just _scratch_mkfs() followed
by mounting it. It does not need to exist at all.

The test(s) need to have run _require_scratch() in it's setup, it
shouldn't be hidden deep inside random functions that fill the
scratch device.

They should also run scratch_mkfs/mount themselves to prep the
scratch device, and then _wipe_fs() can go away entirely.

And the new test simply calls the function to populate the scratch
device at the place where you want to preserve the previous contents
of the scratch device without first running scratch_mkfs....

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2022-04-11  5:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-08 17:08 [PATCH v2] xfs: test xfsdump when an inode < root inode is present Zorro Lang
2022-04-09  4:00 ` Darrick J. Wong
2022-04-10 12:11   ` Zorro Lang
2022-04-11  5:31     ` Dave Chinner [this message]
2022-04-11  8:34       ` Zorro Lang
2022-04-11 22:08         ` Darrick J. Wong
  -- strict thread matches above, loose matches on Subject: below --
2022-03-27 17:39 Zorro Lang

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=20220411053135.GH1609613@dread.disaster.area \
    --to=david@fromorbit.com \
    --cc=djwong@kernel.org \
    --cc=fstests@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