[LTP] [PATCH] cpuset_memory_testset.sh: Fix syntax error when hugepages not supported

Li Wang liwang@redhat.com
Wed Jul 19 11:10:56 CEST 2023


On Wed, Jul 19, 2023 at 4:55 PM Martin Doucha <mdoucha@suse.cz> wrote:

> The initial hugepage size calculation can result in multiplication
> of empty string on machines which don't support hugepages. Make
> sure that empty string is converted to zero.
>
> Signed-off-by: Martin Doucha <mdoucha@suse.cz>
>

Reviewed-by: Li Wang <liwang@redhat.com>

> ---
>  .../cpuset/cpuset_memory_test/cpuset_memory_testset.sh          | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git
> a/testcases/kernel/controllers/cpuset/cpuset_memory_test/cpuset_memory_testset.sh
> b/testcases/kernel/controllers/cpuset/cpuset_memory_test/cpuset_memory_testset.sh
> index cb7dbd867..c1e7cea8f 100755
> ---
> a/testcases/kernel/controllers/cpuset/cpuset_memory_test/cpuset_memory_testset.sh
> +++
> b/testcases/kernel/controllers/cpuset/cpuset_memory_test/cpuset_memory_testset.sh
> @@ -41,7 +41,7 @@ mems_all="$(seq -s, 0 $((nr_mems-1)))"
>  cpu_of_node0=0
>
>  HUGEPAGESIZE=$(awk '/Hugepagesize/{ print $2 }' /proc/meminfo)
> -HUGEPAGESIZE=$(($HUGEPAGESIZE * 1024))
> +HUGEPAGESIZE=$((${HUGEPAGESIZE:-0} * 1024))
>
>  MEMORY_RESULT="$CPUSET_TMP/memory_result"
>
> --
> 2.41.0
>
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
>
>

-- 
Regards,
Li Wang


More information about the ltp mailing list