From 2e6816cc9386681f7d3e73fc257e752ddfad1947 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 22 Feb 2017 19:55:31 -0500 Subject: [PATCH] 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. --- src/basic/cgroup-util.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c index f5b2fe6b6..09c895804 100644 --- a/src/basic/cgroup-util.c +++ b/src/basic/cgroup-util.c @@ -2513,7 +2513,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) -- 2.30.2