From ccf78df1fcaad6b215b17981c42eaef380f69c9c Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Sat, 30 Apr 2016 16:12:54 -0400 Subject: core: make unit_has_mask_realized() consider controller enable state unit_has_mask_realized() determines whether the specified unit has its cgroups set up properly given the desired target_mask; however, on the unified hierarchy, controllers need to be enabled explicitly for children and the mask of enabled controllers can deviate from target_mask. Only considering target_mask in unit_has_mask_realized() can lead to false positives and skipping enabling the requested controllers. This patch adds unit->cgroup_enabled_mask to track which controllers are enabled and updates unit_has_mask_realized() to also consider enable_mask. Signed-off-by: Tejun Heo --- src/core/unit.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/core/unit.h') diff --git a/src/core/unit.h b/src/core/unit.h index 5909652976..78f950c051 100644 --- a/src/core/unit.h +++ b/src/core/unit.h @@ -186,6 +186,7 @@ struct Unit { /* Counterparts in the cgroup filesystem */ char *cgroup_path; CGroupMask cgroup_realized_mask; + CGroupMask cgroup_enabled_mask; CGroupMask cgroup_subtree_mask; CGroupMask cgroup_members_mask; int cgroup_inotify_wd; -- cgit v1.2.3-54-g00ecf