cgroup: Implicit unit_invalidate_cgroup_members_masks

Merge members mask invalidation into
unit_add_siblings_to_cgroup_realize_queue, this way unit_realize_cgroup
needn't be called with members mask invalidation.

We have to retain the members mask invalidation in unit_load -- although
active units would have cgroups (re)realized (unit_load queues for
realization), the realization would happen with potentially stale mask.
This commit is contained in:
Michal Koutný
2020-08-19 11:41:53 +02:00
parent fb46fca7e0
commit f23ba94db3
8 changed files with 6 additions and 9 deletions
+1 -3
View File
@@ -664,10 +664,8 @@ void unit_free(Unit *u) {
/* A unit is being dropped from the tree, make sure our siblings and ancestor slices are realized
* properly. Do this after we detach the unit from slice tree in order to eliminate its effect on
* controller masks. */
if (UNIT_ISSET(u->slice)) {
unit_invalidate_cgroup_members_masks(UNIT_DEREF(u->slice));
if (UNIT_ISSET(u->slice))
unit_add_siblings_to_cgroup_realize_queue(u);
}
if (u->on_console)
manager_unref_console(u->manager);