cgroup: fix delegation on the unified hierarchy
authorLennart Poettering <lennart@poettering.net>
Fri, 17 Nov 2017 18:25:18 +0000 (19:25 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 21 Nov 2017 10:54:08 +0000 (11:54 +0100)
commit64e844e5ca5be2f8766c68bcfb112e4cd84a8bb2
tree6e54ec5701d06bbc558ea24b2ca96442d089554c
parent5e20b0a4522d8d2753ae3991a7aa9f11f1f6cc95
cgroup: fix delegation on the unified hierarchy

Make sure to add the delegation mask to the mask of controllers we have
to enable on our own unit. Do not claim it was a members mask, as such
a logic would mean we'd collide with cgroupv2's "no processes on inner
nodes policy".

This change does the right thing: it means any controller enabled
through Controllers= will be made available to subcrgoups of our unit,
but the unit itself has to still enable it through
cgroup.subtree_control (which it can since that file is delegated too)
to be inherited further down.

Or to say this differently: we only should manipulate
cgroup.subtree_control ourselves for inner nodes (i.e. slices), and
for leaves we need to provide a way to enable controllers in the slices
above, but stay away from the cgroup's own cgroup.subtree_control —
which is what this patch ensures.

Fixes: #7355
src/core/cgroup.c