]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
cgroup-util: fix the case of default=unified, unified-cgroup-hierarchy=0
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 23 Feb 2017 00:55:31 +0000 (19:55 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 23 Feb 2017 00:58:06 +0000 (19:58 -0500)
We should mount the hybrid hierarchy if the user disabled the unified
hierarchy on the kernel command line.

src/basic/cgroup-util.c

index 3222428649427e122d403797556c34c4eda72e64..f76b7f47e5cafc51cf508204035b1c5614871dfe 100644 (file)
@@ -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)