[lxc-devel] [lxc/master] cgfsng: ensure initialized cpuset controller

brauner on Github lxc-bot at linuxcontainers.org
Wed Oct 10 11:29:15 UTC 2018


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 364 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20181010/09b5f7ab/attachment.bin>
-------------- next part --------------
From ecedb5dee9324a967a51b0fa73a6be0630250a42 Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Wed, 10 Oct 2018 13:27:45 +0200
Subject: [PATCH] cgfsng: ensure initialized cpuset controller

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
 src/lxc/cgroups/cgfsng.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c
index 4aa8fe160..1a722ae2f 100644
--- a/src/lxc/cgroups/cgfsng.c
+++ b/src/lxc/cgroups/cgfsng.c
@@ -1153,6 +1153,7 @@ __cgfsng_ops static void cgfsng_monitor_destroy(struct cgroup_ops *ops,
 	for (int i = 0; ops->hierarchies[i]; i++) {
 		int ret;
 		char *chop;
+		char pivot_cgroup[] = PIVOT_CGROUP;
 		struct hierarchy *h = ops->hierarchies[i];
 
 		if (!h->monitor_full_path)
@@ -1174,6 +1175,15 @@ __cgfsng_ops static void cgfsng_monitor_destroy(struct cgroup_ops *ops,
 		if (chop)
 			*chop = '\0';
 
+		/*
+		 * Make sure not to pass in the ro string literal PIVOT_CGROUP
+		 * here.
+		 */
+		if (!cg_legacy_handle_cpuset_hierarchy(h, pivot_cgroup)) {
+			WARN("Failed to handle legacy cpuset controller");
+			goto next;
+		}
+
 		ret = mkdir_p(pivot_path, 0755);
 		if (ret < 0 && errno != EEXIST) {
 			SYSWARN("Failed to create cgroup \"%s\"\n", pivot_path);


More information about the lxc-devel mailing list