Blame SOURCES/nfs-utils-1.3.0-statd-callback.patch

64c563
diff -up nfs-utils-1.3.0/utils/statd/callback.c.orig nfs-utils-1.3.0/utils/statd/callback.c
64c563
--- nfs-utils-1.3.0/utils/statd/callback.c.orig	2014-09-17 13:39:01.009781560 -0400
64c563
+++ nfs-utils-1.3.0/utils/statd/callback.c	2014-09-17 13:39:07.217896069 -0400
64c563
@@ -10,11 +10,13 @@
64c563
 #include <config.h>
64c563
 #endif
64c563
 
64c563
+#include <unistd.h>
64c563
 #include <netdb.h>
64c563
 
64c563
 #include "rpcmisc.h"
64c563
 #include "statd.h"
64c563
 #include "notlist.h"
64c563
+#include "ha-callout.h"
64c563
 
64c563
 /* Callback notify list. */
64c563
 /* notify_list *cbnl = NULL; ... never used */
64c563
@@ -87,6 +89,13 @@ sm_notify_1_svc(struct stat_chge *argp,
64c563
 	xlog(D_CALL, "Received SM_NOTIFY from %s, state: %d",
64c563
 				argp->mon_name, argp->state);
64c563
 
64c563
+	if (!statd_present_address(sap, ip_addr, sizeof(ip_addr))) {
64c563
+		xlog_warn("Unrecognized sender address");
64c563
+		return ((void *) &result);
64c563
+	}
64c563
+
64c563
+	ha_callout("sm-notify", argp->mon_name, ip_addr, argp->state);
64c563
+
64c563
 	/* quick check - don't bother if we're not monitoring anyone */
64c563
 	if (rtnl == NULL) {
64c563
 		xlog_warn("SM_NOTIFY from %s while not monitoring any hosts",
64c563
@@ -94,11 +103,6 @@ sm_notify_1_svc(struct stat_chge *argp,
64c563
 		return ((void *) &result);
64c563
 	}
64c563
 
64c563
-	if (!statd_present_address(sap, ip_addr, sizeof(ip_addr))) {
64c563
-		xlog_warn("Unrecognized sender address");
64c563
-		return ((void *) &result);
64c563
-	}
64c563
-
64c563
 	/* okir change: statd doesn't remove the remote host from its
64c563
 	 * internal monitor list when receiving an SM_NOTIFY call from
64c563
 	 * it. Lockd will want to continue monitoring the remote host
64c563
diff -up nfs-utils-1.3.0/utils/statd/statd.man.orig nfs-utils-1.3.0/utils/statd/statd.man
64c563
--- nfs-utils-1.3.0/utils/statd/statd.man.orig	2014-09-17 13:39:01.009781560 -0400
64c563
+++ nfs-utils-1.3.0/utils/statd/statd.man	2014-09-17 13:39:07.217896069 -0400
64c563
@@ -346,7 +346,8 @@ points due to inactivity.
64c563
 .SS High-availability callouts
64c563
 .B rpc.statd
64c563
 can exec a special callout program during processing of
64c563
-successful SM_MON, SM_UNMON, and SM_UNMON_ALL requests.
64c563
+successful SM_MON, SM_UNMON, and SM_UNMON_ALL requests,
64c563
+or when it receives SM_NOTIFY.
64c563
 Such a program may be used in High Availability NFS (HA-NFS)
64c563
 environments to track lock state that may need to be migrated after
64c563
 a system reboot.
64c563
@@ -357,15 +358,26 @@ option.
64c563
 The program is run with 3 arguments:
64c563
 The first is either
64c563
 .B add-client
64c563
-or
64c563
 .B del-client
64c563
+or
64c563
+.B sm-notify
64c563
 depending on the reason for the callout.
64c563
 The second is the
64c563
 .I mon_name
64c563
 of the monitored peer.
64c563
 The third is the
64c563
-.I caller_name
64c563
-of the requesting lock manager.
64c563
+.I caller_name 
64c563
+of the requesting lock manager for
64c563
+.B add-client
64c563
+or
64c563
+.B del-client
64c563
+, otherwise it is
64c563
+.I IP_address 
64c563
+of the caller sending SM_NOTIFY.
64c563
+The forth is the
64c563
+.I state_value
64c563
+in the SM_NOTIFY request.
64c563
+
64c563
 .SS IPv6 and TI-RPC support
64c563
 TI-RPC is a pre-requisite for supporting NFS on IPv6.
64c563
 If TI-RPC support is built into