]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
cgroups: initialize lxc.pivot cpuset 3444/head
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 10 Jun 2020 15:40:56 +0000 (17:40 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Wed, 10 Jun 2020 15:42:06 +0000 (17:42 +0200)
Closes: #3443.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/cgroups/cgfsng.c

index 05fdc0c5d2512d2d3f9cdf17827a158037d50755..6c64c996c285b2f3c3bd737a6ab4f2f3f00e0f33 100644 (file)
@@ -1082,6 +1082,7 @@ __cgfsng_ops static void cgfsng_monitor_destroy(struct cgroup_ops *ops,
        for (int i = 0; ops->hierarchies[i]; i++) {
                __do_free char *pivot_path = NULL;
                struct hierarchy *h = ops->hierarchies[i];
+               size_t offset;
                int ret;
 
                if (!h->monitor_full_path)
@@ -1094,20 +1095,20 @@ __cgfsng_ops static void cgfsng_monitor_destroy(struct cgroup_ops *ops,
                }
 
                if (conf && conf->cgroup_meta.monitor_dir)
-                       pivot_path = must_make_path(h->mountpoint,
-                                                   h->container_base_path,
-                                                   conf->cgroup_meta.monitor_dir,
-                                                   CGROUP_PIVOT, NULL);
+                       pivot_path = must_make_path(h->mountpoint, h->container_base_path,
+                                                   conf->cgroup_meta.monitor_dir, CGROUP_PIVOT, NULL);
                else if (conf && conf->cgroup_meta.dir)
-                       pivot_path = must_make_path(h->mountpoint,
-                                                   h->container_base_path,
-                                                   conf->cgroup_meta.dir,
-                                                   CGROUP_PIVOT, NULL);
+                       pivot_path = must_make_path(h->mountpoint, h->container_base_path,
+                                                   conf->cgroup_meta.dir, CGROUP_PIVOT, NULL);
                else
-                       pivot_path = must_make_path(h->mountpoint,
-                                                   h->container_base_path,
+                       pivot_path = must_make_path(h->mountpoint, h->container_base_path,
                                                    CGROUP_PIVOT, NULL);
 
+               offset = strlen(h->mountpoint) + strlen(h->container_base_path);
+
+               if (cg_legacy_handle_cpuset_hierarchy(h, pivot_path + offset))
+                       SYSWARN("Failed to initialize cpuset %s/" CGROUP_PIVOT, pivot_path);
+
                ret = mkdir_p(pivot_path, 0755);
                if (ret < 0 && errno != EEXIST) {
                        ERROR("Failed to create %s", pivot_path);