[LTP] [PATCH] cgroup_regression_test: Use unique names for hierarchies in each test

Avinesh Kumar akumar@suse.de
Thu Jul 10 10:24:03 CEST 2025


I forgot to mention that I also tried to use
tst_umount() helper routine, but that did not help as umount does not
really report any failures here.

On Thursday, July 10, 2025 10:17:09 AM CEST Avinesh Kumar wrote:
> Recently we started having failures where mounting cgroup in quick
> succession after umount of same named hierarchy fails with EBUSY
> 
> cgroup_regression_test 1 TPASS: no kernel bug was found
> mount: /tmp/LTP_cgroup_regression_test.ZFwS3JkX4c/cgroup: cgroup already mounted or mount point busy.
>        dmesg(1) may have more information after failed mount system call.
> cgroup_regression_test 2 TFAIL: Failed to mount cgroup filesystem
> 
> Updating test to use unique names for cgroup hierarchies in each
> subtest.
> 
> Suggested-by: Michal Koutný <mkoutny@suse.com>
> Signed-off-by: Avinesh Kumar <akumar@suse.de>
> ---
>  .../controllers/cgroup/cgroup_regression_test.sh       | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh b/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh
> index 276231fe8..c1bf4810f 100755
> --- a/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh
> +++ b/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh
> @@ -93,7 +93,7 @@ test1()
>  	cgroup_regression_fork_processes &
>  	sleep 1
>  
> -	mount -t cgroup -o none,name=foo cgroup cgroup/
> +	mount -t cgroup -o none,name=foo1 cgroup cgroup/
>  	if [ $? -ne 0 ]; then
>  		tst_res TFAIL "failed to mount cgroup filesystem"
>  		kill -TERM $!
> @@ -118,7 +118,7 @@ test2()
>  	local val1
>  	local val2
>  
> -	mount -t cgroup -o none,name=foo cgroup cgroup/
> +	mount -t cgroup -o none,name=foo2 cgroup cgroup/
>  	if [ $? -ne 0 ]; then
>  		tst_res TFAIL "Failed to mount cgroup filesystem"
>  		return
> @@ -204,7 +204,7 @@ test4()
>  		return
>  	fi
>  
> -	mount -t cgroup -o none,name=foo cgroup cgroup/
> +	mount -t cgroup -o none,name=foo4 cgroup cgroup/
>  	mkdir cgroup/0
>  	rmdir cgroup/0
>  	tst_umount $PWD/cgroup
> @@ -309,7 +309,7 @@ test_7_2()
>  {
>  	local subsys=$1
>  
> -	mount -t cgroup -o none,name=foo cgroup cgroup/
> +	mount -t cgroup -o none,name=foo72 cgroup cgroup/
>  	if [ $? -ne 0 ]; then
>  		tst_res TFAIL "failed to mount cgroup"
>  		return
> @@ -370,7 +370,7 @@ test7()
>  #---------------------------------------------------------------------------
>  test8()
>  {
> -	mount -t cgroup -o none,name=foo cgroup cgroup/
> +	mount -t cgroup -o none,name=foo8 cgroup cgroup/
>  	if [ $? -ne 0 ]; then
>  		tst_res TFAIL "failed to mount cgroup filesystem"
>  		return
> 






More information about the ltp mailing list