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