API/cgroup: Try to mount V2 with memory_recursiveprot
PATCH 1/1 API/cgroup: Try to mount V2 with memory_recursiveprot
Moving forwards system managers should always mount with memory_recursiveprot. So we should test with this by default when it is available.
This change will only effect SUTs which do not already have CGroups mounted.
Signed-off-by Richard Palethorpe <[email protected]>
--- lib/tst_cgroup.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
lib/tst_cgroup.c +8 -1
@@ -471,6 +471,7 @@ void tst_cg_scan(void)static void cgroup_mount_v2 (void ) { +int ret;char mnt_path[PATH_MAX ];sprintf (mnt_path,"%s%s" , cgroup_mount_ltp_prefix, cgroup_v2_ltp_mount);
@@ -494,7 +495,13 @@ static void cgroup_mount_v2(void)return ; mount: -if (!mount ("cgroup2" , mnt_path,"cgroup2" ,0 ,NULL )) { + ret =mount ("cgroup2" , mnt_path,"cgroup2" , +0 ,"memory_recursiveprot" ); + +if (ret && errno ==EINVAL ) + ret =mount ("cgroup2" , mnt_path,"cgroup2" ,0 ,NULL ); + +if (!ret) {tst_res (TINFO ,"Mounted V2 CGroups on %s" , mnt_path);tst_cg_scan (); roots[0 ].we_mounted_it =1 ;
Signature · 5 lines
2.34.1 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Quoted 9 lines · Richard Palethorpe
Moving forwards system managers should always mount with
memory_recursiveprot. So we should test with this by default when it is available.This change will only effect SUTs which do not already have CGroups mounted.
Signed-off-by Richard Palethorpe <[email protected]>
Reviewed-by Li Wang <[email protected]>
Signature · 2 lines
Regards, Li Wang
Signature · 2 lines
-- Mailing list info: https://lists.linux.it/listinfo/ltp