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