Unverified Commit ff4e4629 by Stéphane Graber Committed by GitHub

Merge pull request #3664 from brauner/2021-02-10/fixes

cgroups: fixes
parents ae2d267e 25db3f94
......@@ -1483,13 +1483,17 @@ __cgfsng_ops static bool cgfsng_monitor_enter(struct cgroup_ops *ops,
if (ret)
return log_error_errno(false, errno, "Failed to enter cgroup \"%s\"", h->monitor_full_path);
TRACE("Moved monitor into %s cgroup via %d", h->monitor_full_path, h->cgfd_mon);
if (handler->transient_pid <= 0)
return true;
continue;
ret = lxc_writeat(h->cgfd_mon, "cgroup.procs", transient, transient_len);
if (ret)
return log_error_errno(false, errno, "Failed to enter cgroup \"%s\"", h->monitor_full_path);
TRACE("Moved transient process into %s cgroup via %d", h->monitor_full_path, h->cgfd_mon);
/*
* we don't keep the fds for non-unified hierarchies around
* mainly because we don't make use of them anymore after the
......@@ -1528,12 +1532,15 @@ __cgfsng_ops static bool cgfsng_payload_enter(struct cgroup_ops *ops,
struct hierarchy *h = ops->hierarchies[i];
int ret;
if (is_unified_hierarchy(h) && handler->clone_flags & CLONE_INTO_CGROUP)
if (is_unified_hierarchy(h) &&
(handler->clone_flags & CLONE_INTO_CGROUP))
continue;
ret = lxc_writeat(h->cgfd_con, "cgroup.procs", pidstr, len);
if (ret != 0)
return log_error_errno(false, errno, "Failed to enter cgroup \"%s\"", h->container_full_path);
TRACE("Moved container into %s cgroup via %d", h->container_full_path, h->cgfd_con);
}
return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment