From: Christian Brauner Date: Fri, 30 Apr 2021 13:47:35 +0000 (+0200) Subject: cgroups: fix fallback attach codepath X-Git-Tag: lxc-5.0.0~185^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=112ccbc91300b21642daddf77a52c2113c320608;p=thirdparty%2Flxc.git 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 --- 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. */