* [PATCH] xfs/227: fix bad variable expansion
@ 2026-04-17 18:08 Zorro Lang
2026-04-22 15:57 ` Darrick J. Wong
0 siblings, 1 reply; 2+ messages in thread
From: Zorro Lang @ 2026-04-17 18:08 UTC (permalink / raw)
To: fstests; +Cc: Dave Chinner
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>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] xfs/227: fix bad variable expansion
2026-04-17 18:08 [PATCH] xfs/227: fix bad variable expansion Zorro Lang
@ 2026-04-22 15:57 ` Darrick J. Wong
0 siblings, 0 replies; 2+ messages in thread
From: Darrick J. Wong @ 2026-04-22 15:57 UTC (permalink / raw)
To: Zorro Lang; +Cc: fstests, Dave Chinner
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
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-04-22 15:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-17 18:08 [PATCH] xfs/227: fix bad variable expansion Zorro Lang
2026-04-22 15:57 ` Darrick J. Wong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox