FSTests Archive on lore.kernel.org
 help / color / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: Pavel Reichl <preichl@redhat.com>, fstests@vger.kernel.org
Cc: zlang@redhat.com, guan@eryu.me
Subject: Re: [PATCH v2 2/4] common: hide permision warning from mkswap for exfat
Date: Wed, 7 Apr 2021 12:03:08 -0500
Message-ID: <54667422-1a39-7a78-5dda-e417d0323f52@sandeen.net> (raw)
In-Reply-To: <20210330220005.56019-3-preichl@redhat.com>

On 3/30/21 5:00 PM, Pavel Reichl wrote:
> exfat does not support posix file permisions, so warning from mkswap is
> inavitable. This patch hides the warning message so the test won't fail.
> 
> Signed-off-by: Pavel Reichl <preichl@redhat.com>

hah, I never even thought about swap on exfat ;)

Assuming it actually works other than this warning, maybe you don't need to
special case it for exfat? If so just filter that warning for everyone (in the
same way that the CHATTR isn't special cased for btrfs; we just ignore
failures there, because they don't matter).

If there's a real need to special case exfat that's fine, but it might
be better to not litter special cases around if they aren't material
to the test.

also, maybe there is some risk to 2>&1 >> seqres "eating" any other
potential errors? Or maybe my bash fu is weak. ;)

I /think/ this will do the trick but give it a shot. It should filter only
the one string from stderr, and send all of stdout to $seqres.full

# Ignore permission complaints on filesystems that don't support perms
$MKSWAP_PROG "$fname" 2> >(grep -v 'insecure permission' >&2) >> $seqres.full

-Eric

> ---
>  common/rc | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/common/rc b/common/rc
> index 9cdfe21c..2d658711 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -2392,7 +2392,13 @@ _format_swapfile() {
>  	# Swap files must be nocow on Btrfs.
>  	$CHATTR_PROG +C "$fname" > /dev/null 2>&1
>  	_pwrite_byte 0x61 0 "$sz" "$fname" >> $seqres.full
> -	$MKSWAP_PROG "$fname" >> $seqres.full
> +	if [ "$FSTYP" = "exfat" ]; then
> +		# exfat does not support posix file permisions, so warning is
> +		# to be expected
> +		$MKSWAP_PROG "$fname" 2>&1 | grep -v 'insecure permission' >> $seqres.full
> +	else
> +		$MKSWAP_PROG "$fname" >> $seqres.full
> +	fi
>  }
>  
>  # Check that the filesystem supports swapfiles
> 

  reply index

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-30 22:00 [PATCH v2 0/4] Fix some tests that fail for exfat FS Pavel Reichl
2021-03-30 22:00 ` [PATCH v2 1/4] common/rc: Add _require_{chown,chmod,symlink}() Pavel Reichl
2021-03-31  0:25   ` Zorro Lang
2021-03-31  7:17     ` Pavel Reichl
2021-04-01  3:38   ` Eryu Guan
2021-04-01  9:47     ` Pavel Reichl
2021-04-07 16:47       ` Eric Sandeen
2021-03-30 22:00 ` [PATCH v2 2/4] common: hide permision warning from mkswap for exfat Pavel Reichl
2021-04-07 17:03   ` Eric Sandeen [this message]
2021-04-15  9:15     ` Pavel Reichl
2021-03-30 22:00 ` [PATCH v2 3/4] generic/554: hide permision warning on exfat Pavel Reichl
2021-04-01  3:40   ` Eryu Guan
2021-03-30 22:00 ` [PATCH v2 4/4] generic/003: Amend the test for exfat Pavel Reichl
2021-04-07 18:03   ` Eric Sandeen
2021-04-15  9:14     ` Pavel Reichl

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=54667422-1a39-7a78-5dda-e417d0323f52@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=fstests@vger.kernel.org \
    --cc=guan@eryu.me \
    --cc=preichl@redhat.com \
    --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

FSTests Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/fstests/0 fstests/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 fstests fstests/ https://lore.kernel.org/fstests \
		fstests@vger.kernel.org
	public-inbox-index fstests

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.fstests


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git