[LTP] [PATCH 06/16] API/cgroup: refuse to mount blkio when io controller is mounted

Luke Nowakowski-Krijger luke.nowakowskikrijger@canonical.com
Sat Mar 5 00:18:16 CET 2022


Mounting the v1 blkio controller while v2 io controller is mounted
unmounts the io controller, triggering a tst_brk that the number of
controller has gone down.

Because these controllers don't seem to be compatible, tst_brk with
TCONF and report that we refused to mount the blkio controller while the
io controller is mounted.

Signed-off-by: Luke Nowakowski-Krijger <luke.nowakowskikrijger@canonical.com>
---
 lib/tst_cgroup.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/tst_cgroup.c b/lib/tst_cgroup.c
index 4e14a2895..52cbf680b 100644
--- a/lib/tst_cgroup.c
+++ b/lib/tst_cgroup.c
@@ -691,6 +691,11 @@ static void cgroup_mount_v1(struct cgroup_ctrl *const ctrl)
 	char mnt_path[PATH_MAX];
 	int made_dir = 0;
 
+	if (ctrl->ctrl_indx == CTRL_BLKIO && controllers[CTRL_IO].ctrl_root) {
+		tst_brk(TCONF,
+			"IO controller found on V2 root, skipping blkio mount that would unmount IO controller");
+	}
+
 	sprintf(mnt_path, "%s%s", cgroup_mount_ltp_prefix, ctrl->ctrl_name);
 
 	if (!mkdir(mnt_path, 0777)) {
-- 
2.32.0



More information about the ltp mailing list