dryang / rpms / systemd

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