From e7b57cb042130edf86506d189734018edc3f2c18 Mon Sep 17 00:00:00 2001 From: Mrunal Patel Date: Tue, 10 Jan 2017 15:13:28 -0800 Subject: [PATCH] Ignore cgroup2 mountpoints Our current cgroup parsing logic assumes cgroup v1 mounts so we should ignore cgroup2 mounts for now Backport: https://github.com/opencontainers/runc/pull/1266 Signed-off-by: Mrunal Patel Signed-off-by: Aleksa Sarai --- libcontainer/cgroups/utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcontainer/cgroups/utils.go b/libcontainer/cgroups/utils.go index 8946dd5959e4..c6db0039e654 100644 --- a/libcontainer/cgroups/utils.go +++ b/libcontainer/cgroups/utils.go @@ -149,7 +149,7 @@ func getCgroupMountsHelper(ss map[string]bool, mi io.Reader, all bool) ([]Mount, if sepIdx == -1 { return nil, fmt.Errorf("invalid mountinfo format") } - if txt[sepIdx+3:sepIdx+9] != "cgroup" { + if txt[sepIdx+3:sepIdx+10] == "cgroup2" || txt[sepIdx+3:sepIdx+9] != "cgroup" { continue } fields := strings.Split(txt, " ") -- 2.12.2