richardphibel / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
c2dfb7
From e809564cfa5af01a26075682d49f81a987c41dd8 Mon Sep 17 00:00:00 2001
c2dfb7
From: Franck Bui <fbui@suse.com>
c2dfb7
Date: Wed, 2 Oct 2019 11:58:16 +0200
c2dfb7
Subject: [PATCH] pid1: fix DefaultTasksMax initialization
c2dfb7
c2dfb7
Otherwise DefaultTasksMax is always set to "inifinity".
c2dfb7
c2dfb7
This was broken by fb39af4ce42.
c2dfb7
c2dfb7
(cherry picked from commit c0000de87d2c7934cb1f4ba66a533a85277600ff)
c2dfb7
c2dfb7
Resolves: #1809037
c2dfb7
---
c2dfb7
 src/core/main.c | 4 +---
c2dfb7
 1 file changed, 1 insertion(+), 3 deletions(-)
c2dfb7
c2dfb7
diff --git a/src/core/main.c b/src/core/main.c
c2dfb7
index d6550ea161..45d09b1e11 100644
c2dfb7
--- a/src/core/main.c
c2dfb7
+++ b/src/core/main.c
c2dfb7
@@ -2088,7 +2088,7 @@ static void reset_arguments(void) {
c2dfb7
         arg_default_blockio_accounting = false;
c2dfb7
         arg_default_memory_accounting = MEMORY_ACCOUNTING_DEFAULT;
c2dfb7
         arg_default_tasks_accounting = true;
c2dfb7
-        arg_default_tasks_max = UINT64_MAX;
c2dfb7
+        arg_default_tasks_max = system_tasks_max_scale(DEFAULT_TASKS_MAX_PERCENTAGE, 100U);
c2dfb7
         arg_machine_id = (sd_id128_t) {};
c2dfb7
         arg_cad_burst_action = EMERGENCY_ACTION_REBOOT_FORCE;
c2dfb7
 
c2dfb7
@@ -2103,8 +2103,6 @@ static int parse_configuration(const struct rlimit *saved_rlimit_nofile,
c2dfb7
         assert(saved_rlimit_nofile);
c2dfb7
         assert(saved_rlimit_memlock);
c2dfb7
 
c2dfb7
-        arg_default_tasks_max = system_tasks_max_scale(DEFAULT_TASKS_MAX_PERCENTAGE, 100U);
c2dfb7
-
c2dfb7
         /* Assign configuration defaults */
c2dfb7
         reset_arguments();
c2dfb7