[Devel] [PATCH RH7 6/9] Port: diff-fence-watchdog-add-netfilter-action

Pavel Tikhomirov ptikhomirov at virtuozzo.com
Tue Oct 13 07:52:56 PDT 2015


do not check action twice, first time was in fence_wdog_check_timer

Author: Dmitry Guryanov
Email: dguryanov at parallels.com
Subject: watchdog: add netfilter action
Date: Fri, 8 Nov 2013 22:38:08 +0400

Add wdog_tmo netfilter match, which returns true if out watchdog
timeout exceed.

You have to set watchdog action to 'netfilter', so that host won't
reboot or halt.

Fix for:
https://jira.sw.ru/browse/PSBM-23253

Dmitry Guryanov (2):
  watchdog: add netfilter action
  watchdog: add wdog_tmo match

This patch description:

Add netfilter action, which means 'no action': we should't
call fence_wdog_do_fence and should return 0 from
fence_wdog_check_timer (we drop all packets to transmit if it
returns 1).

https://jira.sw.ru/browse/PSBM-23253

Signed-off-by: Dmitry Guryanov <dguryanov at parallels.com>
Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
---
 kernel/fence-watchdog.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/kernel/fence-watchdog.c b/kernel/fence-watchdog.c
index e7b7152..0e6b7ec 100644
--- a/kernel/fence-watchdog.c
+++ b/kernel/fence-watchdog.c
@@ -25,9 +25,10 @@ enum {
 	FENCE_WDOG_CRASH = 0,
 	FENCE_WDOG_REBOOT = 1,
 	FENCE_WDOG_POWEROFF = 2,
+	FENCE_WDOG_NETFILTER = 3,
 };
 
-const char *action_names[] = {"crash", "reboot", "halt", NULL};
+const char *action_names[] = {"crash", "reboot", "halt", "netfilter", NULL};
 
 
 DEFINE_VVAR(volatile unsigned long, fence_wdog_jiffies64) = MAX_U64;
@@ -73,7 +74,8 @@ void fence_wdog_do_fence(void)
 
 inline int fence_wdog_check_timer(void)
 {
-	if (unlikely(get_jiffies_64() > fence_wdog_jiffies64)) {
+	if (unlikely(get_jiffies_64() > fence_wdog_jiffies64 &&
+			fence_wdog_action != FENCE_WDOG_NETFILTER)) {
 		if (atomic_inc_not_zero(&not_fenced))
 			fence_wdog_do_fence();
 		return 1;
-- 
1.9.3




More information about the Devel mailing list