All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] API/cgroup: Try to mount V2 with memory_recursiveprot
@ 2022-03-01 12:23 Richard Palethorpe via ltp
  2022-03-02  2:10 ` Li Wang
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Palethorpe via ltp @ 2022-03-01 12:23 UTC (permalink / raw)
  To: ltp; +Cc: 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 <rpalethorpe@suse.com>
---
 lib/tst_cgroup.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/lib/tst_cgroup.c b/lib/tst_cgroup.c
index dc090b70a..8cca0654d 100644
--- a/lib/tst_cgroup.c
+++ b/lib/tst_cgroup.c
@@ -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;
-- 
2.34.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [LTP] [PATCH] API/cgroup: Try to mount V2 with memory_recursiveprot
  2022-03-01 12:23 [LTP] [PATCH] API/cgroup: Try to mount V2 with memory_recursiveprot Richard Palethorpe via ltp
@ 2022-03-02  2:10 ` Li Wang
  0 siblings, 0 replies; 2+ messages in thread
From: Li Wang @ 2022-03-02  2:10 UTC (permalink / raw)
  To: Richard Palethorpe; +Cc: LTP List


[-- Attachment #1.1: Type: text/plain, Size: 438 bytes --]

On Tue, Mar 1, 2022 at 8:29 PM Richard Palethorpe <rpalethorpe@suse.com>
wrote:

> 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 <rpalethorpe@suse.com>
>

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


-- 
Regards,
Li Wang

[-- Attachment #1.2: Type: text/html, Size: 1190 bytes --]

[-- Attachment #2: Type: text/plain, Size: 60 bytes --]


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-02  2:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-01 12:23 [LTP] [PATCH] API/cgroup: Try to mount V2 with memory_recursiveprot Richard Palethorpe via ltp
2022-03-02  2:10 ` Li Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.