daandemeyer / rpms / systemd

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