Commit 054d4518 authored by Ivan Shapovalov's avatar Ivan Shapovalov Committed by Pavel Emelyanov

cgroup: we won't walk the same path for the same hierarchy twice in add_cgroup(), so BUG() it

Signed-off-by: 's avatarIvan Shapovalov <intelfx@intelfx.name>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 7f0643f9
...@@ -514,10 +514,6 @@ static int add_cgroup(const char *fpath, const struct stat *sb, int typeflag) ...@@ -514,10 +514,6 @@ static int add_cgroup(const char *fpath, const struct stat *sb, int typeflag)
mtype = find_dir(ncd->path, &current_controller->heads, &match); mtype = find_dir(ncd->path, &current_controller->heads, &match);
switch (mtype) { switch (mtype) {
/* ignore co-mounted cgroups */
case EXACT_MATCH:
exit_code = 0;
goto out;
case PARENT_MATCH: case PARENT_MATCH:
list_add_tail(&ncd->siblings, &match->children); list_add_tail(&ncd->siblings, &match->children);
match->n_children++; match->n_children++;
...@@ -526,6 +522,8 @@ static int add_cgroup(const char *fpath, const struct stat *sb, int typeflag) ...@@ -526,6 +522,8 @@ static int add_cgroup(const char *fpath, const struct stat *sb, int typeflag)
list_add_tail(&ncd->siblings, &current_controller->heads); list_add_tail(&ncd->siblings, &current_controller->heads);
current_controller->n_heads++; current_controller->n_heads++;
break; break;
/* the same hierarchy won't be walked twice for a single process */
case EXACT_MATCH:
default: default:
BUG(); BUG();
} }
......
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