]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/slice: make slice_freezer_action() return 0 if freezing state is unchanged
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 6 May 2022 05:01:22 +0000 (14:01 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 9 May 2022 14:43:32 +0000 (23:43 +0900)
Fixes #23278.

src/core/slice.c
src/core/unit.c

index 2e43c00119012742b5f85efbb44ee7fa30cc9eec..c453aa033e7115bbeadea61c05e793226785abfe 100644 (file)
@@ -389,11 +389,7 @@ static int slice_freezer_action(Unit *s, FreezerAction action) {
                         return r;
         }
 
-        r = unit_cgroup_freezer_action(s, action);
-        if (r < 0)
-                return r;
-
-        return 1;
+        return unit_cgroup_freezer_action(s, action);
 }
 
 static int slice_freeze(Unit *s) {
index fcfc9bc8d2bea9809d04e065e38645670b6b2e27..b0756bc6f43bfd2ff01db18f1dd7517c1455d7e0 100644 (file)
@@ -5849,6 +5849,8 @@ static int unit_freezer_action(Unit *u, FreezerAction action) {
         if (r <= 0)
                 return r;
 
+        assert(IN_SET(u->freezer_state, FREEZER_FREEZING, FREEZER_THAWING));
+
         return 1;
 }