From 112ccbc91300b21642daddf77a52c2113c320608 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Fri, 30 Apr 2021 15:47:35 +0200 Subject: [PATCH] cgroups: fix fallback attach codepath When we attach to an old server the server can return ENOSYS instead of ENOCGROUP2 which causes LXC to abort the attach unnecessary. Fix this! Signed-off-by: Christian Brauner --- src/lxc/cgroups/cgfsng.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index f66790a4d..9e1ece5ca 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -2293,7 +2293,7 @@ static int __cg_unified_attach(const struct hierarchy *h, ret = cgroup_attach(conf, name, lxcpath, pid); if (ret == 0) return log_trace(0, "Attached to unified cgroup via command handler"); - if (ret != -ENOCGROUP2) + if (!ERRNO_IS_NOT_SUPPORTED(ret) && ret != -ENOCGROUP2) return log_error_errno(ret, errno, "Failed to attach to unified cgroup"); /* Fall back to retrieving the path for the unified cgroup. */ -- 2.47.2