Commit e3311ea3 authored by Pavel Emelyanov's avatar Pavel Emelyanov

cgroup: Skip unified hier controllers (v2)

The unified hierarchy controller doesn't have any name, so criu hangs
while parsing this sort of strings.

Let's skip those for now, until we implement cgroup2 support.

https://github.com/xemul/criu/issues/252

v2: Code comments
Reported-and-tested-by: 's avatarAdrian Reber <adrian@lisas.de>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 3ef5a5e2
......@@ -2252,8 +2252,19 @@ int parse_cgroup_file(FILE *f, struct list_head *retl, unsigned int *n)
* 2:name=systemd:/user.slice/user-1000.slice/session-1.scope
*/
name = strchr(buf, ':');
if (name)
if (name) {
path = strchr(++name, ':');
if (*name == ':') {
/*
* It's unified hierarchy. On kernels with legacy
* tree this item is added automatically, so we
* can just skip one. For those with full unified
* support is on ... we need to write new code.
*/
xfree(ncc);
continue;
}
}
if (!name || !path) {
pr_err("Failed parsing cgroup %s\n", buf);
xfree(ncc);
......@@ -2417,6 +2428,13 @@ int collect_controllers(struct list_head *cgroups, unsigned int *n_cgroups)
}
controllers++;
if (*controllers == ':')
/*
* Unified hier. See comment in parse_cgroup_file
* for more details.
*/
continue;
off = strchr(controllers, ':');
if (!off) {
pr_err("Unable to parse \"%s\"\n", buf);
......
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