]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
cgfsng: copy parent's cpu settings for monitor too 2641/head
authorChristian Brauner <christian.brauner@ubuntu.com>
Sun, 23 Sep 2018 14:26:31 +0000 (16:26 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sun, 23 Sep 2018 14:26:31 +0000 (16:26 +0200)
Closes https://github.com/lxc/lxd/issues/5060.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/cgroups/cgfsng.c

index 0f3296919ac7f5084dabfe9ea32d4039342ad135..cfe842ce212c5186b6af5925398f1a3555378e33 100644 (file)
@@ -586,8 +586,7 @@ static bool cg_legacy_handle_cpuset_hierarchy(struct hierarchy *h, char *cgname)
                }
        }
 
-       clonechildrenpath =
-           must_make_path(cgpath, "cgroup.clone_children", NULL);
+       clonechildrenpath = must_make_path(cgpath, "cgroup.clone_children", NULL);
        /* unified hierarchy doesn't have clone_children */
        if (!file_exists(clonechildrenpath)) {
                free(clonechildrenpath);
@@ -1201,6 +1200,11 @@ static bool monitor_create_path_for_hierarchy(struct hierarchy *h, char *cgname)
        if (dir_exists(h->monitor_full_path))
                return true;
 
+       if (!cg_legacy_handle_cpuset_hierarchy(h, cgname)) {
+               ERROR("Failed to handle legacy cpuset controller");
+               return false;
+       }
+
        ret = mkdir_p(h->monitor_full_path, 0755);
        if (ret < 0) {
                ERROR("Failed to create cgroup \"%s\"", h->monitor_full_path);