cgfsng: do not reuse another monitor's cgroup

Otherwise we will create a race. Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent 907e1332
...@@ -1262,8 +1262,10 @@ static bool monitor_create_path_for_hierarchy(struct hierarchy *h, char *cgname) ...@@ -1262,8 +1262,10 @@ static bool monitor_create_path_for_hierarchy(struct hierarchy *h, char *cgname)
int ret; int ret;
h->monitor_full_path = must_make_path(h->mountpoint, h->container_base_path, cgname, NULL); h->monitor_full_path = must_make_path(h->mountpoint, h->container_base_path, cgname, NULL);
if (dir_exists(h->monitor_full_path)) if (dir_exists(h->monitor_full_path)) {
return true; ERROR("The cgroup \"%s\" already existed", h->monitor_full_path);
return false;
}
if (!cg_legacy_handle_cpuset_hierarchy(h, cgname)) { if (!cg_legacy_handle_cpuset_hierarchy(h, cgname)) {
ERROR("Failed to handle legacy cpuset controller"); ERROR("Failed to handle legacy cpuset controller");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment