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