The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/3129
This e-mail was sent by the LXC bot, direct replies will not reach the author unless they happen to be subscribed to this list. === Description (from pull-request) === Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com>
From 6607d6e91d271ee493a72c1bc3b2589c77222909 Mon Sep 17 00:00:00 2001 From: Christian Brauner <christian.brau...@ubuntu.com> Date: Wed, 28 Aug 2019 20:33:39 +0200 Subject: [PATCH] cgroups: initialize cgroup root directory Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com> --- src/lxc/cgroups/cgfsng.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index 44ec5a0bec..be1fd87733 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -1764,7 +1764,7 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops, struct lxc_handler *handler, const char *root, int type) { - __do_free char *tmpfspath = NULL; + __do_free char *cgroup_root = NULL; int ret; bool has_cgns = false, retval = false, wants_force_mount = false; @@ -1796,23 +1796,21 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops, type = LXC_AUTO_CGROUP_FULL_MIXED; if (ops->cgroup_layout == CGROUP_LAYOUT_UNIFIED) { - __do_free char *unified_path = NULL; - - unified_path = must_make_path(root, "/sys/fs/cgroup", NULL); + cgroup_root = must_make_path(root, "/sys/fs/cgroup", NULL); if (has_cgns && wants_force_mount) { /* If cgroup namespaces are supported but the container * will not have CAP_SYS_ADMIN after it has started we * need to mount the cgroups manually. */ return cg_mount_in_cgroup_namespace(type, ops->unified, - unified_path) == 0; + cgroup_root) == 0; } - return cg_mount_cgroup_full(type, ops->unified, unified_path) == 0; + return cg_mount_cgroup_full(type, ops->unified, cgroup_root) == 0; } /* mount tmpfs */ - ret = safe_mount(NULL, tmpfspath, "tmpfs", + ret = safe_mount(NULL, cgroup_root, "tmpfs", MS_NOSUID | MS_NODEV | MS_NOEXEC | MS_RELATIME, "size=10240k,mode=755", root); if (ret < 0) @@ -1827,7 +1825,7 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops, continue; controller++; - controllerpath = must_make_path(tmpfspath, controller, NULL); + controllerpath = must_make_path(cgroup_root, controller, NULL); if (dir_exists(controllerpath)) continue;
_______________________________________________ lxc-devel mailing list lxc-devel@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-devel