linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zorro Lang <zlang@redhat.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: guaneryu@gmail.com, fstests@vger.kernel.org, linux-xfs@vger.kernel.org
Subject: Re: [PATCH v2] xfs: test xfs_info on block device and mountpoint
Date: Wed, 26 Jun 2019 01:12:48 +0800	[thread overview]
Message-ID: <20190625171248.GH30864@dhcp-12-102.nay.redhat.com> (raw)
In-Reply-To: <20190625143616.GD5380@magnolia>

On Tue, Jun 25, 2019 at 07:36:16AM -0700, Darrick J. Wong wrote:
> On Tue, Jun 25, 2019 at 03:16:39PM +0800, Zorro Lang wrote:
> > On Tue, Jun 25, 2019 at 10:45:46AM +0800, Eryu Guan wrote:
> > > On Mon, Jun 24, 2019 at 09:21:03AM +0800, Zorro Lang wrote:
> > > > On Sun, Jun 23, 2019 at 02:49:19PM -0700, Darrick J. Wong wrote:
> > > > > On Sat, Jun 22, 2019 at 11:38:27PM +0800, Zorro Lang wrote:
> > > > > > There was a bug, xfs_info fails on a mounted block device:
> > > > > > 
> > > > > >   # xfs_info /dev/mapper/testdev
> > > > > >   xfs_info: /dev/mapper/testdev contains a mounted filesystem
> > > > > > 
> > > > > >   fatal error -- couldn't initialize XFS library
> > > > > > 
> > > > > > xfsprogs has fixed it by:
> > > > > > 
> > > > > >   bbb43745 xfs_info: use findmnt to handle mounted block devices
> > > > > > 
> > > > > > Signed-off-by: Zorro Lang <zlang@redhat.com>
> > > > > 
> > > > > Aha!  I remembered something -- xfs/449 already checks for consistency
> > > > > in the various xfs geometry reports that each command provides, so why
> > > > > not just add the $XFS_INFO_PROG $SCRATCH_DEV case at the end?
> > 
> > Hmm... But I hope the case can keep running xfs_info test even there're not
> > xfs_spaceman -c "info" or xfs_db -c "info", just skip these two steps. Due
> > to RHEL-7 has old xfsprogs, we'd like to cover bug on RHEL-7.
> > 
> > What do you think?
> 
> If there isn't an xfs_db -c info command then xfs_info <blockev> won't
> work because that's what it does internally.
> 
> Sooo unless you're backporting the new xfs_db info command to rhel7
> xfsprogs as well as the new xfs_info wrapper, the test ought to just
> _notrun on rhel7.

No, I'm not trying to test an unmount <blockdev>. I'm trying to run
xfs_info on a mounted <blockdev>.

There was a bug. RHEL-7 xfsprogs can get a mounted device info:

# xfs_growfs -p xfs_info -n /dev/mapper/home 
meta-data=/dev/mapper/home isize=512    agcount=4, agsize=47341056 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=0 spinodes=0
data     =                       bsize=4096   blocks=189364224, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal               bsize=4096   blocks=92463, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0


But RHEL-8.0 xfsprogs can't do that:

# xfs_info /dev/mapper/xfshome
xfs_info: /dev/mapper/xfshome contains a mounted filesystem

fatal error -- couldn't initialize XFS library

Thanks,
Zorro

> 
> --D
> 
> > > > 
> > > > Wow, there're so many cases, can't sure what we've covered now:)
> > > > 
> > > > Sure, I can do this change on xfs/449, if Eryu thinks it's fine to increase
> > > > the test coverage of a known case.
> > > 
> > > Given that we're having more and more tests and the test time grows
> > > quickly, I'm fine now with adding such small & similar test to existing
> > > test case to reuse the test setups, especially when XFS maintainer
> > > agrees to do so :)
> > > 
> > > Thanks,
> > > Eryu

      reply	other threads:[~2019-06-25 17:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-22 15:38 [PATCH v2] xfs: test xfs_info on block device and mountpoint Zorro Lang
2019-06-23 21:49 ` Darrick J. Wong
2019-06-24  1:21   ` Zorro Lang
2019-06-25  2:45     ` Eryu Guan
2019-06-25  7:16       ` Zorro Lang
2019-06-25 14:36         ` Darrick J. Wong
2019-06-25 17:12           ` Zorro Lang [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=20190625171248.GH30864@dhcp-12-102.nay.redhat.com \
    --to=zlang@redhat.com \
    --cc=darrick.wong@oracle.com \
    --cc=fstests@vger.kernel.org \
    --cc=guaneryu@gmail.com \
    --cc=linux-xfs@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).