chiark / gitweb /
cgroup: fix delegation on the unified hierarchy
authorLennart Poettering <lennart@poettering.net>
Fri, 17 Nov 2017 18:25:18 +0000 (19:25 +0100)
committerSven Eden <yamakuzure@gmx.net>
Fri, 17 Nov 2017 18:25:18 +0000 (19:25 +0100)
commit03ba805e0d91929785ab1fb4c40f1c0c3a117374
treec1a5fb09fce68e85bdf1ecc507f3b844ae8c738b
parent4949a3907ec926fe478c0914721f9657c4fe847d
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