diff mbox series

[v3] common/rc: fix MKSWAP_PROG quoting

Message ID 20210901094024.424whsgozs5lwyzo@xzhoux.usersys.redhat.com (mailing list archive)
State New, archived
Headers show
Series [v3] common/rc: fix MKSWAP_PROG quoting | expand

Commit Message

Murphy Zhou Sept. 1, 2021, 9:40 a.m. UTC
After commit
  0e4dd8b9 common/rc: fix ignoring of errors on
we are getting this error message when running swapfiles tests:
  +./common/rc: line 2553: MKSWAP_PROG: command not found

Rewrite the line.

Signed-off-by: Murphy Zhou <xzhou@redhat.com>
---

Thanks all for the suggestions!

v2:
  rewrite the line and add a filter
  source filters for generic/643
v3:
  drop the filter, use grep

 common/rc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Darrick J. Wong Sept. 3, 2021, 5:48 p.m. UTC | #1
On Wed, Sep 01, 2021 at 05:40:24PM +0800, Xiong Zhou wrote:
> After commit
>   0e4dd8b9 common/rc: fix ignoring of errors on
> we are getting this error message when running swapfiles tests:
>   +./common/rc: line 2553: MKSWAP_PROG: command not found
> 
> Rewrite the line.
> 
> Signed-off-by: Murphy Zhou <xzhou@redhat.com>

Aha, I was wondering why the test counts were lower after last Sunday's
rebase.  Works for me, so:

Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> ---
> 
> Thanks all for the suggestions!
> 
> v2:
>   rewrite the line and add a filter
>   source filters for generic/643
> v3:
>   drop the filter, use grep
> 
>  common/rc | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/common/rc b/common/rc
> index 46b6b220..00f3023f 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -2550,7 +2550,8 @@ _format_swapfile() {
>  	$CHATTR_PROG +C "$fname" > /dev/null 2>&1
>  	_pwrite_byte 0x61 0 "$sz" "$fname" >> $seqres.full
>  	# Ignore permission complaints on filesystems that don't support perms
> -	$(MKSWAP_PROG "$fname" 2> >(grep -v 'insecure permission' >&2)) >> $seqres.full
> +	$MKSWAP_PROG "$fname" 2>&1 >> $seqres.full | \
> +		grep -v "insecure permission"
>  }
>  
>  _swapon_file() {
> -- 
> 2.20.1
>
diff mbox series

Patch

diff --git a/common/rc b/common/rc
index 46b6b220..00f3023f 100644
--- a/common/rc
+++ b/common/rc
@@ -2550,7 +2550,8 @@  _format_swapfile() {
 	$CHATTR_PROG +C "$fname" > /dev/null 2>&1
 	_pwrite_byte 0x61 0 "$sz" "$fname" >> $seqres.full
 	# Ignore permission complaints on filesystems that don't support perms
-	$(MKSWAP_PROG "$fname" 2> >(grep -v 'insecure permission' >&2)) >> $seqres.full
+	$MKSWAP_PROG "$fname" 2>&1 >> $seqres.full | \
+		grep -v "insecure permission"
 }
 
 _swapon_file() {