teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone

Blame SOURCES/0595-core-fix-the-reversed-sanity-check-when-setting-Star.patch

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