Mixing cgroup2 and legacy cgroup systems such that some controllers are enabled
in legacy cgroup hierarchies and other controllers in the unified hierarchies
is simply not something we're supporting. Even systemd's hybrid layout (crazy)
doesn't bind controllers to the unified cgroup hierarchy.
Fixes: #3183
Cc: Thomas Moschny <thomas.moschny@gmx.de>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
return ret_set_errno(false, EINVAL);
conf = handler->conf;
- if (lxc_list_empty(&conf->cgroup2))
- return true;
cgroup_settings = &conf->cgroup2;
+ if (lxc_list_empty(cgroup_settings))
+ return true;
+
+ if (!pure_unified_layout(ops))
+ return log_warn_errno(true, EINVAL, "Ignoring cgroup2 limits on legacy cgroup system");
if (!ops->unified)
return false;