From: Christian Brauner Date: Wed, 17 Feb 2021 15:40:48 +0000 (+0100) Subject: cgroups: create controller directories if missing X-Git-Tag: lxc-5.0.0~280^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77410c983cc680db0baec2abc80235754e13ba6f;p=thirdparty%2Flxc.git cgroups: create controller directories if missing Signed-off-by: Christian Brauner --- diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index c2259bf5a..fb4f9fb7f 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -2179,12 +2179,9 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops, cgroup_root = must_make_path(rootfs_mnt, DEFAULT_CGROUP_MOUNTPOINT, NULL); controllerpath = must_make_path(cgroup_root, controller, NULL); - if (dir_exists(controllerpath)) - continue; - path2 = must_make_path(controllerpath, h->container_base_path, ops->container_cgroup, NULL); ret = mkdir_p(path2, 0755); - if (ret < 0) + if (ret < 0 && (errno != EEXIST)) return false; ret = cg_legacy_mount_controllers(cg_flags, h, controllerpath, path2, ops->container_cgroup);