]> git.proxmox.com Git - mirror_lxc.git/commitdiff
cgroups: fix fallback attach codepath
authorChristian Brauner <christian.brauner@ubuntu.com>
Fri, 30 Apr 2021 13:47:35 +0000 (15:47 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Fri, 30 Apr 2021 13:49:39 +0000 (15:49 +0200)
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 <christian.brauner@ubuntu.com>
src/lxc/cgroups/cgfsng.c

index f66790a4df2e61661ef87cce4c3c37902378c27b..9e1ece5ca94473c63ca018b0a0df9e45a965079b 100644 (file)
@@ -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. */