selftests: cgroup: Preserve command arguments in with_stress.sh

with_stress.sh invokes the requested command through unquoted $*. This
subjects the arguments to word splitting and pathname expansion:
arguments containing whitespace are split, empty arguments disappear,
and literal wildcard characters can expand to filenames.

Invoke the command through "$@" so that the command name and each
argument are passed as supplied by the caller.

Assisted-by: LLM
Signed-off-by: Ren Tamura <ren.tamura.oss@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
Ren Tamura 2026-09-30 15:03:34 +09:00 committed by Tejun Heo
parent 7b56cc82e5
commit 7b00d5eecf

View File

@ -87,7 +87,7 @@ time=0
start=$(date +%s)
while [ $time -lt $duration ] ; do
$*
"$@"
rc=$?
[ $rc -eq 0 ] || break
time=$(($(date +%s) - $start))