From 838d155694526ed2da3260f4255b10ccb5d85a46 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Wed, 17 Feb 2021 01:43:51 +0100 Subject: [PATCH] start: delegate than move into the target cgroup This is a way more sensible model. Signed-off-by: Christian Brauner --- src/lxc/start.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lxc/start.c b/src/lxc/start.c index 466897dad..6bba836f5 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -1806,13 +1806,13 @@ static int lxc_spawn(struct lxc_handler *handler) goto out_delete_net; } - if (!cgroup_ops->payload_enter(cgroup_ops, handler)) { - ERROR("Failed to enter cgroups"); + if (!cgroup_ops->payload_delegate_controllers(cgroup_ops)) { + ERROR("Failed to delegate controllers to payload cgroup"); goto out_delete_net; } - if (!cgroup_ops->payload_delegate_controllers(cgroup_ops)) { - ERROR("Failed to delegate controllers to payload cgroup"); + if (!cgroup_ops->payload_enter(cgroup_ops, handler)) { + ERROR("Failed to enter cgroups"); goto out_delete_net; } @@ -2027,14 +2027,14 @@ int __lxc_start(struct lxc_handler *handler, struct lxc_operations *ops, goto out_abort; } - if (!cgroup_ops->monitor_enter(cgroup_ops, handler)) { - ERROR("Failed to enter monitor cgroup"); + if (!cgroup_ops->monitor_delegate_controllers(cgroup_ops)) { + ERROR("Failed to delegate controllers to monitor cgroup"); ret = -1; goto out_abort; } - if (!cgroup_ops->monitor_delegate_controllers(cgroup_ops)) { - ERROR("Failed to delegate controllers to monitor cgroup"); + if (!cgroup_ops->monitor_enter(cgroup_ops, handler)) { + ERROR("Failed to enter monitor cgroup"); ret = -1; goto out_abort; } -- 2.47.2