From: Lennart Poettering Date: Fri, 23 Nov 2018 00:03:18 +0000 (+0100) Subject: cgroup: extend reasons when we realize the enable mask X-Git-Tag: v240~225^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1fd3a10c38a0be4fc42ae94cf9f8401003187b80;p=thirdparty%2Fsystemd.git cgroup: extend reasons when we realize the enable mask After creating a cgroup we need to initialize its "cgroup.subtree_control" file with the controllers its children want to use. Currently we do so whenever the mkdir() on the cgroup succeeded, i.e. when we know the cgroup is "fresh". Let's update the condition slightly that we also do so when internally we assume a cgroup doesn't exist yet, even if it already does (maybe left-over from a previous run). This shouldn't change anything IRL but make things a bit more robust. --- diff --git a/src/core/cgroup.c b/src/core/cgroup.c index 1dc62ba45fb..988813c38bf 100644 --- a/src/core/cgroup.c +++ b/src/core/cgroup.c @@ -1615,7 +1615,7 @@ static int unit_create_cgroup( (void) unit_watch_cgroup(u); /* Preserve enabled controllers in delegated units, adjust others. */ - if (created || !unit_cgroup_delegate(u)) { + if (created || !u->cgroup_realized || !unit_cgroup_delegate(u)) { CGroupMask result_mask = 0; /* Enable all controllers we need */