All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Zorro Lang <zlang@kernel.org>
Cc: fstests@vger.kernel.org, Dave Chinner <dgc@kernel.org>
Subject: Re: [PATCH] xfs/227: fix bad variable expansion
Date: Wed, 22 Apr 2026 08:57:51 -0700	[thread overview]
Message-ID: <20260422155751.GF7739@frogsfrogsfrogs> (raw)
In-Reply-To: <20260417180839.282768-1-zlang@kernel.org>

On Sat, Apr 18, 2026 at 02:08:39AM +0800, Zorro Lang wrote:
> The create_data() set cmd_str to "-c \"resvsp $((off * 4096)) 4096\".
> That cause xfs_io can't split the command line properly, it fails as:
> 
>   command ""resvsp" not found
> 
> Fixes: aaf40fb7 ("fstests: xfs/227 is really slow")
> Signed-off-by: Zorro Lang <zlang@kernel.org>

Glomming CLI arguments into a string is quite a bash antipattern.

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

--D

> ---
>  tests/xfs/227 | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/xfs/227 b/tests/xfs/227
> index 7f8ee2db..ed505b18 100755
> --- a/tests/xfs/227
> +++ b/tests/xfs/227
> @@ -78,13 +78,13 @@ create_attrs()
>  create_data()
>  {
>  	local blocks=$1
> -	local cmd_str
> +	local cmd_args=()
>  
>  	for off in `seq $blocks -1 0`; do
> -		cmd_str="-c \"resvsp $((off * 4096)) 4096\" $cmd_str"
> +		cmd_args+=("-c" "resvsp $((off * 4096)) 4096")
>  	done
>  	$XFS_IO_PROG -f -c "truncate $((($blocks + 1) * 4096))" \
> -			$cmd_str $2 >> seqres.full 2>&1
> +			"${cmd_args[@]}" $2 >> $seqres.full 2>&1
>  }
>  
>  # create the designated file with a certain number of attributes and a certain
> -- 
> 2.52.0
> 
> 

      reply	other threads:[~2026-04-22 15:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-17 18:08 [PATCH] xfs/227: fix bad variable expansion Zorro Lang
2026-04-22 15:57 ` Darrick J. Wong [this message]

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=20260422155751.GF7739@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=dgc@kernel.org \
    --cc=fstests@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.