From: Christian Brauner Date: Wed, 10 Oct 2018 11:27:45 +0000 (+0200) Subject: cgfsng: ensure initialized cpuset controller X-Git-Tag: lxc-3.1.0~51^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ecedb5dee9324a967a51b0fa73a6be0630250a42;p=thirdparty%2Flxc.git cgfsng: ensure initialized cpuset controller Signed-off-by: Christian Brauner --- 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);