c2dfb7
From abf2fb67dc3d7da8db030ea8b8db73a20acc08a9 Mon Sep 17 00:00:00 2001
c2dfb7
From: Michal Sekletar <msekleta@redhat.com>
c2dfb7
Date: Thu, 7 May 2020 17:23:30 +0200
c2dfb7
Subject: [PATCH] core/cgroup: fix return value of unit_cgorup_freezer_action()
c2dfb7
c2dfb7
We should return 0 only if current freezer state, as reported by the
c2dfb7
kernel, is already the desired state. Otherwise, we would dispatch
c2dfb7
return dbus message prematurely in bus_unit_method_freezer_generic().
c2dfb7
c2dfb7
Thanks to Frantisek Sumsal for reporting the issue.
c2dfb7
c2dfb7
(cherry picked from commit d910f4c2b2542544d7b187a09605da7a0f220837)
c2dfb7
c2dfb7
Related: #1830861
c2dfb7
---
c2dfb7
 src/core/cgroup.c | 2 +-
c2dfb7
 1 file changed, 1 insertion(+), 1 deletion(-)
c2dfb7
c2dfb7
diff --git a/src/core/cgroup.c b/src/core/cgroup.c
c2dfb7
index e7ae9273a6..2d819b8ebb 100644
c2dfb7
--- a/src/core/cgroup.c
c2dfb7
+++ b/src/core/cgroup.c
c2dfb7
@@ -2963,7 +2963,7 @@ int unit_cgroup_freezer_action(Unit *u, FreezerAction action) {
c2dfb7
         if (r < 0)
c2dfb7
                 return r;
c2dfb7
 
c2dfb7
-        return 0;
c2dfb7
+        return 1;
c2dfb7
 }
c2dfb7
 
c2dfb7
 static const char* const cgroup_device_policy_table[_CGROUP_DEVICE_POLICY_MAX] = {