dd65c9
From 468004bfb6efeef42b9191ee218304f0ab492654 Mon Sep 17 00:00:00 2001
dd65c9
From: Tejun Heo <htejun@fb.com>
dd65c9
Date: Mon, 23 May 2016 16:48:46 -0400
dd65c9
Subject: [PATCH] core: fix the reversed sanity check when setting
dd65c9
 StartupBlockIOWeight over dbus
dd65c9
dd65c9
bus_cgroup_set_property() was rejecting if the input value was in range.
dd65c9
Reverse it.
dd65c9
dd65c9
Cherry-picked from: 6fb09269769634df1096663ce90fac47585eb63a
dd65c9
Resolves: #1302305
dd65c9
---
dd65c9
 src/core/dbus-cgroup.c | 2 +-
dd65c9
 1 file changed, 1 insertion(+), 1 deletion(-)
dd65c9
dd65c9
diff --git a/src/core/dbus-cgroup.c b/src/core/dbus-cgroup.c
dd65c9
index ffeeb5aa9..66b1324fe 100644
dd65c9
--- a/src/core/dbus-cgroup.c
dd65c9
+++ b/src/core/dbus-cgroup.c
dd65c9
@@ -324,7 +324,7 @@ int bus_cgroup_set_property(
dd65c9
                 if (r < 0)
dd65c9
                         return r;
dd65c9
 
dd65c9
-                if (CGROUP_BLKIO_WEIGHT_IS_OK(weight))
dd65c9
+                if (!CGROUP_BLKIO_WEIGHT_IS_OK(weight))
dd65c9
                         return sd_bus_error_set_errnof(error, EINVAL, "StartupBlockIOWeight value out of range");
dd65c9
 
dd65c9
                 if (mode != UNIT_CHECK) {