]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
cgroups: skip v2 hierarchy entry 1290/head
authorChristian Brauner <christian.brauner@canonical.com>
Thu, 10 Nov 2016 23:29:15 +0000 (00:29 +0100)
committerChristian Brauner <christian.brauner@canonical.com>
Thu, 10 Nov 2016 23:31:04 +0000 (00:31 +0100)
Signed-off-by: Christian Brauner <christian.brauner@canonical.com>
src/lxc/cgroups/cgfsng.c

index ec940995f000405665a9828015115af0ad70dd86..992096a83003f419a3cd153567f4d2d138a7ac72 100644 (file)
@@ -686,6 +686,18 @@ static void get_existing_subsystems(char ***klist, char ***nlist)
                if (!p2)
                        continue;
                *p2 = '\0';
+
+               /* If we have a mixture between cgroup v1 and cgroup v2
+                * hierarchies, then /proc/self/cgroup contains entries of the
+                * form:
+                *
+                *      0::/some/path
+                *
+                * We need to skip those.
+                */
+               if ((p2 - p) == 0)
+                       continue;
+
                for (tok = strtok_r(p, ",", &saveptr); tok;
                                tok = strtok_r(NULL, ",", &saveptr)) {
                        if (strncmp(tok, "name=", 5) == 0)