All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gao Xiang <hsiangkao@redhat.com>
To: Zorro Lang <zlang@redhat.com>
Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org
Subject: Re: [RFC PATCH v2 1/3] common/xfs: add a _require_xfs_shrink helper
Date: Fri, 12 Mar 2021 23:18:47 +0800	[thread overview]
Message-ID: <20210312151847.GA272122@xiangao.remote.csb> (raw)
In-Reply-To: <20210312152506.GJ3499219@localhost.localdomain>

Hi Zorro,

On Fri, Mar 12, 2021 at 11:25:06PM +0800, Zorro Lang wrote:
> On Fri, Mar 12, 2021 at 09:22:58PM +0800, Gao Xiang wrote:
> > In order to detect whether the current kernel supports XFS shrinking.
> > 
> > Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
> > ---
> > use -D1 rather than -D0 since xfs_growfs would report unchanged size
> > instead.
> > 
> >  common/xfs | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> > 
> > diff --git a/common/xfs b/common/xfs
> > index 2156749d..326edacc 100644
> > --- a/common/xfs
> > +++ b/common/xfs
> > @@ -432,6 +432,16 @@ _supports_xfs_scrub()
> >  	return 0
> >  }
> >  
> > +_require_xfs_shrink()
> > +{
> > +	_scratch_mkfs_xfs >/dev/null 2>&1
> > +
> > +	_scratch_mount
> > +	$XFS_GROWFS_PROG -D1 "$SCRATCH_MNT" 2>&1 | grep -q 'Invalid argument' || { \
> > +		_scratch_unmount; _notrun "kernel does not support shrinking"; }
> 	        ^^^^
> 		I think this unmount isn't necessary, due to after "_notrun" the
> 		$SCRATCH_DEV will be umounted "automatically".

I didn't dig into it more. Just follow _require_xfs_scratch_rmapbt().

If it's not necessary (assumed ./check does that), will update it in
the next version. Thanks for your suggestion.

Thanks,
Gao Xiang


  reply	other threads:[~2021-03-12 15:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-12 13:22 [RFC PATCH v2 0/3] xfs: testcases for shrinking free space in the last AG Gao Xiang
2021-03-12 13:22 ` [RFC PATCH v2 1/3] common/xfs: add a _require_xfs_shrink helper Gao Xiang
2021-03-12 15:25   ` Zorro Lang
2021-03-12 15:18     ` Gao Xiang [this message]
2021-03-12 13:22 ` [RFC PATCH v2 2/3] xfs: basic functionality test for shrinking free space in the last AG Gao Xiang
2021-03-12 15:56   ` Zorro Lang
2021-03-12 16:04     ` Gao Xiang
2021-03-12 13:23 ` [RFC PATCH v2 3/3] xfs: stress " Gao Xiang
2021-03-12 16:17   ` Zorro Lang
2021-03-12 16:17     ` Gao Xiang
2021-03-12 16:37       ` Darrick J. Wong
2021-03-12 16:58         ` Gao Xiang

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=20210312151847.GA272122@xiangao.remote.csb \
    --to=hsiangkao@redhat.com \
    --cc=fstests@vger.kernel.org \
    --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.