daandemeyer / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
52b84b
From 8e1cc941607263a4f8454d0d6d5939aec3be1fcb Mon Sep 17 00:00:00 2001
52b84b
From: David Tardon <dtardon@redhat.com>
52b84b
Date: Tue, 23 Jun 2020 13:58:21 +0200
52b84b
Subject: [PATCH] fix mis-merge
52b84b
52b84b
Resolves: #1848421
52b84b
---
52b84b
 src/core/cgroup.c | 4 +++-
52b84b
 1 file changed, 3 insertions(+), 1 deletion(-)
52b84b
52b84b
diff --git a/src/core/cgroup.c b/src/core/cgroup.c
52b84b
index 2d819b8ebb..e0eb184fd2 100644
52b84b
--- a/src/core/cgroup.c
52b84b
+++ b/src/core/cgroup.c
52b84b
@@ -664,11 +664,13 @@ static void cgroup_apply_legacy_cpu_config(Unit *u, uint64_t shares, uint64_t qu
52b84b
 
52b84b
         if (quota != USEC_INFINITY) {
52b84b
                 xsprintf(buf, USEC_FMT "\n", MAX(quota * period / USEC_PER_SEC, USEC_PER_MSEC));
52b84b
+                r = cg_set_attribute("cpu", u->cgroup_path, "cpu.cfs_quota_us", buf);
52b84b
+        }
52b84b
+        else
52b84b
                 r = cg_set_attribute("cpu", u->cgroup_path, "cpu.cfs_quota_us", "-1");
52b84b
         if (r < 0)
52b84b
                 log_unit_full(u, IN_SET(r, -ENOENT, -EROFS, -EACCES) ? LOG_DEBUG : LOG_WARNING, r,
52b84b
                               "Failed to set cpu.cfs_quota_us: %m");
52b84b
-        }
52b84b
 }
52b84b
 
52b84b
 static uint64_t cgroup_cpu_shares_to_weight(uint64_t shares) {