public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: "Nirjhar Roy (IBM)" <nirjhar.roy.lists@gmail.com>
Cc: fstests@vger.kernel.org, linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org, ritesh.list@gmail.com,
	ojaswin@linux.ibm.com, zlang@kernel.org
Subject: Re: [PATCH v1 1/3] xfs/539: Skip noattr2 remount option on v5 filesystems
Date: Wed, 12 Feb 2025 13:06:10 -0800	[thread overview]
Message-ID: <20250212210610.GY21799@frogsfrogsfrogs> (raw)
In-Reply-To: <8704e5bd46d9f8dc37cec2781104704fa7213aa3.1739363803.git.nirjhar.roy.lists@gmail.com>

On Wed, Feb 12, 2025 at 12:39:56PM +0000, Nirjhar Roy (IBM) wrote:
> This test is to verify that repeated warnings are not printed
> for default options (attr2, noikeep) and warnings are
> printed for non default options (noattr2, ikeep). Remount
> with noattr2 fails on a v5 filesystem, so skip the mount option.
> 
> Signed-off-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com>
> ---
>  tests/xfs/539 | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/xfs/539 b/tests/xfs/539
> index b9bb7cc1..58eead67 100755
> --- a/tests/xfs/539
> +++ b/tests/xfs/539
> @@ -42,7 +42,8 @@ echo "Silence is golden."
>  
>  # Skip old kernels that did not print the warning yet
>  log_tag
> -_scratch_mkfs > $seqres.full 2>&1
> +is_v5=true
> +_scratch_mkfs |& grep -q "crc=0" && is_v5=false >> $seqres.full 2>&1

Usually we do this with something more like:

_scratch_mkfs | _filter_mkfs >>$seqres.full 2>$tmp.mkfs
. $tmp.mkfs

if [ $_fs_has_crcs -eq 1 ]; then
	# v5 stuff
else
	# v4 stuff
endif

>  _scratch_mount -o attr2
>  _scratch_unmount
>  check_dmesg_for_since_tag "XFS: attr2 mount option is deprecated" || \
> @@ -60,8 +61,13 @@ for VAR in {attr2,noikeep}; do
>  		echo "Should not be able to find deprecation warning for $VAR"
>  done
>  for VAR in {noattr2,ikeep}; do
> +	if [[ "$VAR" == "noattr2" ]] && $is_v5; then
> +		echo "remount with noattr2 will fail in v5 filesystem. Skip" \
> +			>> $seqres.full
> +		continue

/me wonders if it'd be cleaner to do:

VARS=(ikeep)
test $_fs_has_crcs -eq 0 && VARS+=(noattr2)

for VAR in "${VARS[@]}"; do
	...
done

> +	fi
>  	log_tag
> -	_scratch_remount $VAR
> +    _scratch_remount $VAR >> $seqres.full 2>&1

Nit: Indentation.

--D

>  	check_dmesg_for_since_tag "XFS: $VAR mount option is deprecated" || \
>  		echo "Could not find deprecation warning for $VAR"
>  done
> -- 
> 2.34.1
> 
> 

  parent reply	other threads:[~2025-02-12 21:06 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-12 12:39 [PATCH v1 0/3] Add mount and remount related tests Nirjhar Roy (IBM)
2025-02-12 12:39 ` [PATCH v1 1/3] xfs/539: Skip noattr2 remount option on v5 filesystems Nirjhar Roy (IBM)
2025-02-12 21:01   ` Dave Chinner
2025-02-13 10:08     ` Nirjhar Roy (IBM)
2025-02-24  4:50     ` Nirjhar Roy (IBM)
2025-02-12 21:06   ` Darrick J. Wong [this message]
2025-02-12 12:39 ` [PATCH v1 2/3] common/xfs: Add a new helper function to check v5 XFS Nirjhar Roy (IBM)
2025-02-12 21:23   ` Dave Chinner
2025-02-12 12:39 ` [PATCH v1 3/3] xfs: Add a testcase to check remount with noattr2 on a v5 xfs Nirjhar Roy (IBM)
2025-02-12 21:47   ` Dave Chinner
2025-02-13 10:00     ` Nirjhar Roy (IBM)
2025-02-13 21:49       ` Dave Chinner
2025-02-17  4:48         ` Nirjhar Roy (IBM)
2025-02-17 22:29           ` Dave Chinner
2025-02-19 15:04             ` Nirjhar Roy (IBM)

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=20250212210610.GY21799@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=nirjhar.roy.lists@gmail.com \
    --cc=ojaswin@linux.ibm.com \
    --cc=ritesh.list@gmail.com \
    --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