public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Chandan Babu R <chandan.babu@oracle.com>
Cc: fstests@vger.kernel.org, zlang@kernel.org, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 2/4] common/xfs: Add helper to check if nrext64 option is supported
Date: Wed, 8 Jun 2022 09:01:50 +1000	[thread overview]
Message-ID: <20220607230150.GQ1098723@dread.disaster.area> (raw)
In-Reply-To: <20220606124101.263872-3-chandan.babu@oracle.com>

On Mon, Jun 06, 2022 at 06:10:59PM +0530, Chandan Babu R wrote:
> This commit adds a new helper to allow tests to check if xfsprogs and xfs
> kernel module support nrext64 option.
> 
> Signed-off-by: Chandan Babu R <chandan.babu@oracle.com>
> ---
>  common/xfs | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/common/xfs b/common/xfs
> index 2123a4ab..dca7af57 100644
> --- a/common/xfs
> +++ b/common/xfs
> @@ -1328,3 +1328,16 @@ _xfs_filter_mkfs()
>  		print STDOUT "realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX\n";
>  	}'
>  }
> +
> +_require_scratch_xfs_nrext64()
> +{
> +	_require_scratch

Not needed - caller should be doing that first.

> +
> +	_scratch_mkfs -i nrext64=1 &>/dev/null || \
> +		_notrun "mkfs.xfs doesn't support nrext64 feature"

_scratch_mkfs_xfs_supported -i nrext64=1

see for example:

_require_xfs_mkfs_crc

> +	_try_scratch_mount || \
> +		_notrun "kernel doesn't support xfs nrext64 feature"
> +	$XFS_INFO_PROG "$SCRATCH_MNT" | grep -q -w "nrext64=1" || \
> +		_notrun "nrext64 feature not advertised on mount?"

This seems unnecessary - if mkfs supports the feature bit, and the
kernel supports is, this should just work. We don't do checks like
this in any other feature bit test. e.g:

_require_xfs_finobt
_require_xfs_sparse_inodes

etc.

Also, you should put this in the same region of the file as all the
other feature checks, not right down the bottom by itself.

Cheers,

Dave.

-- 
Dave Chinner
david@fromorbit.com

  parent reply	other threads:[~2022-06-08  1:12 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-06 12:40 [PATCH 0/4] Large extent counters tests Chandan Babu R
2022-06-06 12:40 ` [PATCH 1/4] xfs/270: Fix ro mount failure when nrext64 option is enabled Chandan Babu R
2022-06-06 15:31   ` Darrick J. Wong
2022-06-07 23:51   ` Dave Chinner
2022-06-08  8:22     ` Chandan Babu R
2022-06-06 12:40 ` [PATCH 2/4] common/xfs: Add helper to check if nrext64 option is supported Chandan Babu R
2022-06-06 15:30   ` Darrick J. Wong
2022-06-07 23:01   ` Dave Chinner [this message]
2022-06-08  8:15     ` Chandan Babu R
2022-06-06 12:41 ` [PATCH 3/4] xfs/547: Verify that the correct inode extent counters are updated with/without nrext64 Chandan Babu R
2022-06-06 15:40   ` Darrick J. Wong
2022-06-07  9:36     ` Chandan Babu R
2022-06-08  3:59       ` Zorro Lang
2022-06-08  9:11         ` Chandan Babu R
2022-06-06 12:41 ` [PATCH 4/4] xfs/548: Verify correctness of upgrading an fs to support large extent counters Chandan Babu R
2022-06-06 15:35   ` Darrick J. Wong
2022-06-07  9:47     ` Chandan Babu R
2022-06-07 15:20       ` Darrick J. Wong

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=20220607230150.GQ1098723@dread.disaster.area \
    --to=david@fromorbit.com \
    --cc=chandan.babu@oracle.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=zlang@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