From: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
To: linux-nfs@vger.kernel.org
Cc: Rong Zeng <rongzeng@us.ibm.com>,
Steve Dickson <steved-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: [PATCH] Adding a callback for incoming sm_notify.
Date: Wed, 07 May 2014 14:46:06 -0700 [thread overview]
Message-ID: <536AA99E.6070108@linux.vnet.ibm.com> (raw)
From: rong zeng <rongzeng@oc1547780626.ibm.com>
1. "sm-notify" callout name
2. monitored client name as in the SM_NOTIFY request
3. IP of the sender of the SM_NOITFY request.
4. state value in the SM_NOTIFY request
This new interface can be used by different HA-NFS product
in its specific configuration and environment to
recover from the client crash and stale lock scenarios.
Signed-off-by: Rong Zeng <rongzeng@us.ibm.com>
Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
---
utils/statd/callback.c | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/utils/statd/callback.c b/utils/statd/callback.c
index d1cc139..58ba70b 100644
--- a/utils/statd/callback.c
+++ b/utils/statd/callback.c
@@ -15,6 +15,7 @@
#include "rpcmisc.h"
#include "statd.h"
#include "notlist.h"
+#include "ha-callout.h"
/* Callback notify list. */
/* notify_list *cbnl = NULL; ... never used */
@@ -87,6 +88,13 @@ sm_notify_1_svc(struct stat_chge *argp, struct
svc_req *rqstp)
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 +102,6 @@ sm_notify_1_svc(struct stat_chge *argp, struct
svc_req *rqstp)
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
--
1.7.1
reply other threads:[~2014-05-07 21:46 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=536AA99E.6070108@linux.vnet.ibm.com \
--to=jvrao@linux.vnet.ibm.com \
--cc=linux-nfs@vger.kernel.org \
--cc=rongzeng@us.ibm.com \
--cc=steved-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).