Skip to content

Commit

Permalink
cgroups: create controller directories if missing
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Feb 17, 2021
1 parent 51feb8d commit 77410c9
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/lxc/cgroups/cgfsng.c
Expand Up @@ -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);
Expand Down

0 comments on commit 77410c9

Please sign in to comment.