]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
pid1: fix DefaultTasksMax initialization
authorFranck Bui <fbui@suse.com>
Wed, 2 Oct 2019 09:58:16 +0000 (11:58 +0200)
committerThe Plumber <50238977+systemd-rhel-bot@users.noreply.github.com>
Mon, 9 Mar 2020 11:41:34 +0000 (12:41 +0100)
Otherwise DefaultTasksMax is always set to "inifinity".

This was broken by fb39af4ce42.

(cherry picked from commit c0000de87d2c7934cb1f4ba66a533a85277600ff)

Resolves: #1809037

src/core/main.c

index d6550ea161479bc830d91096272b5090e90a410d..45d09b1e119163dccdcb6134f2ce12cf1a680364 100644 (file)
@@ -2088,7 +2088,7 @@ static void reset_arguments(void) {
         arg_default_blockio_accounting = false;
         arg_default_memory_accounting = MEMORY_ACCOUNTING_DEFAULT;
         arg_default_tasks_accounting = true;
-        arg_default_tasks_max = UINT64_MAX;
+        arg_default_tasks_max = system_tasks_max_scale(DEFAULT_TASKS_MAX_PERCENTAGE, 100U);
         arg_machine_id = (sd_id128_t) {};
         arg_cad_burst_action = EMERGENCY_ACTION_REBOOT_FORCE;
 
@@ -2103,8 +2103,6 @@ static int parse_configuration(const struct rlimit *saved_rlimit_nofile,
         assert(saved_rlimit_nofile);
         assert(saved_rlimit_memlock);
 
-        arg_default_tasks_max = system_tasks_max_scale(DEFAULT_TASKS_MAX_PERCENTAGE, 100U);
-
         /* Assign configuration defaults */
         reset_arguments();