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

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