In commit c26b474 the if condition was removed in favor of the if guard
on the higher level. However, this introduced functional change, the
watchdog now updates immediately after update_watchdog is set to 0,
potentially causing fencing after x+1 seconds instead of x seconds. This
behavior is incorrect because updating the watchdog after declaring no
more updates makes no logical sense.

Signed-off-by: Maximiliano Sandoval <m.sando...@proxmox.com>
---
 src/watchdog-mux.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/watchdog-mux.c b/src/watchdog-mux.c
index 889cea2..272060d 100644
--- a/src/watchdog-mux.c
+++ b/src/watchdog-mux.c
@@ -280,8 +280,10 @@ int main(void) {
                 }
             }
 
-            if (ioctl(watchdog_fd, WDIOC_KEEPALIVE, 0) == -1) {
-                perror("watchdog update failed");
+            if (update_watchdog) {
+                if (ioctl(watchdog_fd, WDIOC_KEEPALIVE, 0) == -1) {
+                    perror("watchdog update failed");
+                }
             }
 
             continue;
-- 
2.47.2



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to