From: Zbigniew Jędrzejewski-Szmek Date: Thu, 23 Feb 2017 00:55:31 +0000 (-0500) Subject: cgroup-util: fix the case of default=unified, unified-cgroup-hierarchy=0 X-Git-Tag: v233~41^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c19739db9ec705b4afdad32301e8750b5e02c7d3;p=thirdparty%2Fsystemd.git cgroup-util: fix the case of default=unified, unified-cgroup-hierarchy=0 We should mount the hybrid hierarchy if the user disabled the unified hierarchy on the kernel command line. --- diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c index 32224286494..f76b7f47e5c 100644 --- a/src/basic/cgroup-util.c +++ b/src/basic/cgroup-util.c @@ -2447,7 +2447,10 @@ bool cg_is_hybrid_wanted(void) { static thread_local int wanted = -1; int r; bool b; - const bool is_default = DEFAULT_HIERARCHY == CGROUP_UNIFIED_SYSTEMD; + const bool is_default = DEFAULT_HIERARCHY >= CGROUP_UNIFIED_SYSTEMD; + /* We default to true if the default is "hybrid", obviously, + * but also when the default is "unified", because if we get + * called, it means that unified hierarchy was not mounted. */ /* If we have a cached value, return that. */ if (wanted >= 0)