[Devel] [PATCH RHEL7 COMMIT] fence-watchdog: Port: diff-fence-watchdog-add-netfilter-action

Konstantin Khorenko khorenko at virtuozzo.com
Wed Nov 18 03:59:13 PST 2015


The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.9.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-229.7.2.vz7.9.10
------>
commit f071c2866885158cca2d69682ffb7eea29d46f89
Author: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
Date:   Wed Nov 18 15:59:13 2015 +0400

    fence-watchdog: Port: diff-fence-watchdog-add-netfilter-action
    
    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>
    Acked-by: Andrew Vagin <avagin 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;


More information about the Devel mailing list