From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id C80231FF141 for ; Fri, 13 Feb 2026 11:11:19 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id E313934B37; Fri, 13 Feb 2026 11:12:02 +0100 (CET) From: Friedrich Weber To: pve-devel@lists.proxmox.com Subject: [PATCH corosync] cherry-pick fix for updating knet timeouts on token timeout change Date: Fri, 13 Feb 2026 11:11:15 +0100 Message-ID: <20260213101121.107073-1-f.weber@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1770977482945 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.013 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: XOUNRH27IX4ORGFSOP73EUSBZFXZX3DH X-Message-ID-Hash: XOUNRH27IX4ORGFSOP73EUSBZFXZX3DH X-MailFrom: f.weber@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: When updating the token timeout of a running cluster (e.g. by changing token_coefficient in corosync.conf), kronosnet's knet_ping_timeout and knet_ping_interval were not updated due to a corosync bug [1]. Backport the fix to ensure all timeouts are correctly updated in case users change the token_coefficient. [1] https://github.com/corosync/corosync/issues/813 Signed-off-by: Friedrich Weber --- ...g-Fix-knet-ping-timer-calc-on-reload.patch | 111 ++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 112 insertions(+) create mode 100644 debian/patches/0004-totemconfig-Fix-knet-ping-timer-calc-on-reload.patch diff --git a/debian/patches/0004-totemconfig-Fix-knet-ping-timer-calc-on-reload.patch b/debian/patches/0004-totemconfig-Fix-knet-ping-timer-calc-on-reload.patch new file mode 100644 index 0000000..d8d078f --- /dev/null +++ b/debian/patches/0004-totemconfig-Fix-knet-ping-timer-calc-on-reload.patch @@ -0,0 +1,111 @@ +From 51f361d38b2a6799a0b59f5b0b9ccb1a2ea03e22 Mon Sep 17 00:00:00 2001 +From: Jan Friesse +Date: Wed, 11 Feb 2026 18:30:47 +0100 +Subject: [PATCH] totemconfig: Fix knet ping timer calc on reload + +calc_knet_ping_timers relies on the totem timeout, which is set by +totem_volatile_config_read. Therefore, it must be called last. + +Previously, during a reload, the calculation was called as part of +totemconfig_configure_new_params, which runs before +totem_volatile_config_read. This caused the calculation to ignore +the new token timeout. + +The solution is to call it after totemconfig_configure_new_params in +message_handler_req_exec_cfg_reload_config, mirroring the behavior +during the initial load in totem_config_read. + +This requires exporting the function and allowing the use of a +different icmap than the global one. + +Fixes #813 + +Signed-off-by: Jan Friesse +Reviewed-by: Christine Caulfield +(cherry picked from commit 29206cdf698fbfda506222cf598ebf2a76764163) +Signed-off-by: Friedrich Weber +--- + exec/cfg.c | 3 +++ + exec/totemconfig.c | 10 ++++------ + exec/totemconfig.h | 4 ++++ + 3 files changed, 11 insertions(+), 6 deletions(-) + +diff --git a/exec/cfg.c b/exec/cfg.c +index 1c4e0d57..267f172b 100644 +--- a/exec/cfg.c ++++ b/exec/cfg.c +@@ -798,6 +798,9 @@ static void message_handler_req_exec_cfg_reload_config ( + goto reload_fini; + } + ++ /* knet ping timers when unset depends on token timeout so this needs to be done last of all */ ++ totem_calc_knet_ping_timers(&new_config, temp_map); ++ + /* Validate dynamic parameters */ + if (totem_volatile_config_validate(&new_config, temp_map, &error_string) == -1) { + log_printf (LOGSYS_LEVEL_ERROR, "Configuration is not valid: %s\n", error_string); +diff --git a/exec/totemconfig.c b/exec/totemconfig.c +index 505424e3..41fd74da 100644 +--- a/exec/totemconfig.c ++++ b/exec/totemconfig.c +@@ -1120,7 +1120,7 @@ static int check_for_duplicate_nodeids( + * interface params, but the totem params need to have them to be read first. We + * need both, so this is a way round that circular dependancy. + */ +-static void calc_knet_ping_timers(struct totem_config *totem_config) ++void totem_calc_knet_ping_timers(struct totem_config *totem_config, icmap_map_t temp_map) + { + char runtime_key_name[ICMAP_KEYNAME_MAXLEN]; + int interface; +@@ -1137,7 +1137,7 @@ static void calc_knet_ping_timers(struct totem_config *totem_config) + } + snprintf(runtime_key_name, sizeof(runtime_key_name), + "runtime.config.totem.interface.%d.knet_ping_timeout", interface); +- icmap_set_uint32(runtime_key_name, totem_config->interfaces[interface].knet_ping_timeout); ++ icmap_set_uint32_r(temp_map, runtime_key_name, totem_config->interfaces[interface].knet_ping_timeout); + + if (!totem_config->interfaces[interface].knet_ping_interval) { + totem_config->interfaces[interface].knet_ping_interval = +@@ -1145,7 +1145,7 @@ static void calc_knet_ping_timers(struct totem_config *totem_config) + } + snprintf(runtime_key_name, sizeof(runtime_key_name), + "runtime.config.totem.interface.%d.knet_ping_interval", interface); +- icmap_set_uint32(runtime_key_name, totem_config->interfaces[interface].knet_ping_interval); ++ icmap_set_uint32_r(temp_map, runtime_key_name, totem_config->interfaces[interface].knet_ping_interval); + } + } + } +@@ -1991,7 +1991,7 @@ extern int totem_config_read ( + */ + totem_volatile_config_read(totem_config, icmap_get_global_map(), NULL); + +- calc_knet_ping_timers(totem_config); ++ totem_calc_knet_ping_timers(totem_config, icmap_get_global_map()); + + /* This is now done in the totemknet interface callback */ + /* configure_totem_links(totem_config, icmap_get_global_map()); */ +@@ -2407,8 +2407,6 @@ int totemconfig_configure_new_params( + return -1; + } + +- calc_knet_ping_timers(totem_config); +- + log_printf(LOGSYS_LEVEL_DEBUG, "Configuration reloaded. Dumping actual totem config."); + debug_dump_totem_config(totem_config); + +diff --git a/exec/totemconfig.h b/exec/totemconfig.h +index a0b2e10d..51dc8dd5 100644 +--- a/exec/totemconfig.h ++++ b/exec/totemconfig.h +@@ -90,4 +90,8 @@ extern int totemconfig_commit_new_params( + struct totem_config *totem_config, + icmap_map_t map); + ++extern void totem_calc_knet_ping_timers( ++ struct totem_config *totem_config, ++ icmap_map_t temp_map); ++ + #endif /* TOTEMCONFIG_H_DEFINED */ +-- +2.47.3 + diff --git a/debian/patches/series b/debian/patches/series index 147e793..656a135 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,4 @@ 0001-Enable-PrivateTmp-in-the-systemd-service-files.patch 0002-only-start-corosync.service-if-conf-exists.patch 0003-totemsrp-Check-size-of-orf_token-msg.patch +0004-totemconfig-Fix-knet-ping-timer-calc-on-reload.patch -- 2.47.3