]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
cgroups: create controller directories if missing 3680/head
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 17 Feb 2021 15:40:48 +0000 (16:40 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Wed, 17 Feb 2021 15:56:55 +0000 (16:56 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/cgroups/cgfsng.c

index c2259bf5a78b9a69fe3537f8ac7cb73e72d81559..fb4f9fb7f0416149c819080cfb68eea4deb2a050 100644 (file)
@@ -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);