Linux NFS development
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Anna Schumaker <anna@kernel.org>
Cc: fstests@vger.kernel.org, linux-nfs@vger.kernel.org
Subject: Re: [PATCH 3/4] generic/578: Test that filefrag is supported before running
Date: Wed, 23 Feb 2022 08:57:29 -0800	[thread overview]
Message-ID: <20220223165729.GH8288@magnolia> (raw)
In-Reply-To: <20220208215232.491780-4-anna@kernel.org>

On Tue, Feb 08, 2022 at 04:52:31PM -0500, Anna Schumaker wrote:
> From: Anna Schumaker <Anna.Schumaker@Netapp.com>
> 
> NFS does not support FIBMAP/FIEMAP, so the check for non-shared extents
> on NFS v4.2 always fails with the message: "FIBMAP/FIEMAP unsupported".
> I added the _require_filefrag check for NFS and other filesystems that
> don't have FIEMAP or FIBMAP support.
> 
> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
> ---
>  common/rc         | 14 ++++++++++++++
>  tests/generic/578 |  2 +-
>  2 files changed, 15 insertions(+), 1 deletion(-)
> 
> diff --git a/common/rc b/common/rc
> index b3289de985d8..73d17da9430e 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -4673,6 +4673,20 @@ _require_inode_limits()
>  	fi
>  }
>  
> +_require_filefrag()
> +{
> +	_require_command "$FILEFRAG_PROG" filefrag
> +
> +	local file="$TEST_DIR/filefrag_testfile"
> +
> +	echo "XX" > $file

Nit: You might want to rm -f $file before echoing into it, just in case
some future knave ;) sets up that pathname to point to a named pipe or
something that will hang fstests...

> +	${FILEFRAG_PROG} $file 2>&1 | grep -q "FIBMAP/FIEMAP[[:space:]]*unsupported"
> +	if [ $? -eq 0 ]; then

...and rm it again here to avoid leaving test files around.

Otherwise this looks ok to me.

--D

> +		_notrun "FIBMAP/FIEMAP not supported by this filesystem"
> +	fi
> +	rm -f $file
> +}
> +
>  _require_filefrag_options()
>  {
>  	_require_command "$FILEFRAG_PROG" filefrag
> diff --git a/tests/generic/578 b/tests/generic/578
> index 01929a280f8c..64c813032cf8 100755
> --- a/tests/generic/578
> +++ b/tests/generic/578
> @@ -23,7 +23,7 @@ _cleanup()
>  # real QA test starts here
>  _supported_fs generic
>  _require_test_program "mmap-write-concurrent"
> -_require_command "$FILEFRAG_PROG" filefrag
> +_require_filefrag
>  _require_test_reflink
>  _require_cp_reflink
>  
> -- 
> 2.35.1
> 

  reply	other threads:[~2022-02-23 16:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-08 21:52 [PATCH 0/4] Improvements for NFS Anna Schumaker
2022-02-08 21:52 ` [PATCH 1/4] check: Export CHECK_OPTIONS and PLATFORM for Xunit Reporting Anna Schumaker
2022-02-08 21:52 ` [PATCH 2/4] generic/531: Move test from 'quick' group to 'stress' Anna Schumaker
2022-02-23 16:54   ` Darrick J. Wong
2022-02-23 19:38     ` Anna Schumaker
2022-02-24  4:14       ` Darrick J. Wong
2022-02-08 21:52 ` [PATCH 3/4] generic/578: Test that filefrag is supported before running Anna Schumaker
2022-02-23 16:57   ` Darrick J. Wong [this message]
2022-02-23 18:24     ` Anna Schumaker
2022-02-24  4:15       ` Darrick J. Wong
2022-02-08 21:52 ` [PATCH 4/4] generic/633: Check if idmapped mounts are " Anna Schumaker
2022-02-19  8:40   ` Su Yue

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=20220223165729.GH8288@magnolia \
    --to=djwong@kernel.org \
    --cc=anna@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=linux-nfs@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