All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wendy Cheng <wcheng@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [RFC PATCH 3/3] NLM lock failover = statd enablement
Date: Thu, 29 Jun 2006 14:35:36 -0400	[thread overview]
Message-ID: <44A41D78.5000201@redhat.com> (raw)

This kernel patch has *not* been tested out yet and it needs to be 
paired with user mode nfs-utils changes (not ready in time for this 
RFC). It is included in this submission just to give people a complete 
picture of the implementation. The patch will enable rpc.statd to put 
the correct taken-over IPv4 address in standard dot notation into the 
3rd parameter of ha_callout program (see man rpc.statd for details) for 
"add-client" event. Upon "del-client" event, we would assume the 
monitored host should be removed from server-wide lists, regardless 
individual server's interface.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: gfs_statd.patch
URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20060629/eaba1979/attachment.ksh>

WARNING: multiple messages have this Message-ID (diff)
From: Wendy Cheng <wcheng@redhat.com>
To: nfs@lists.sourceforge.net, cluster-devel@redhat.com
Cc: Lon Hohberger <lhh@redhat.com>
Subject: [RFC PATCH 3/3] NLM lock failover = statd enablement
Date: Thu, 29 Jun 2006 14:35:36 -0400	[thread overview]
Message-ID: <44A41D78.5000201@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 590 bytes --]

This kernel patch has *not* been tested out yet and it needs to be 
paired with user mode nfs-utils changes (not ready in time for this 
RFC). It is included in this submission just to give people a complete 
picture of the implementation. The patch will enable rpc.statd to put 
the correct taken-over IPv4 address in standard dot notation into the 
3rd parameter of ha_callout program (see man rpc.statd for details) for 
"add-client" event. Upon "del-client" event, we would assume the 
monitored host should be removed from server-wide lists, regardless 
individual server's interface.

[-- Attachment #2: gfs_statd.patch --]
[-- Type: text/plain, Size: 5315 bytes --]

 fs/lockd/clntproc.c            |    2 +-
 fs/lockd/host.c                |    2 +-
 fs/lockd/mon.c                 |   21 +++++++++++++--------
 fs/lockd/svc4proc.c            |    2 +-
 fs/lockd/svcproc.c             |    2 +-
 include/linux/lockd/sm_inter.h |    5 +++--
 6 files changed, 20 insertions(+), 14 deletions(-)

--- linux-2.6.17-2/include/linux/lockd/sm_inter.h	2006-06-27 22:52:32.000000000 -0400
+++ linux-2.6.17-3/include/linux/lockd/sm_inter.h	2006-06-28 23:20:02.000000000 -0400
@@ -25,6 +25,7 @@
  */
 struct nsm_args {
 	u32		addr;		/* remote address */
+	u32		serv;		/* server ip address */
 	u32		prog;		/* RPC callback info */
 	u32		vers;
 	u32		proc;
@@ -39,8 +40,8 @@ struct nsm_res {
 	u32		state;
 };
 
-int		nsm_monitor(struct nlm_host *);
-int		nsm_unmonitor(struct nlm_host *);
+int		nsm_monitor(struct nlm_host *, __u32 *serv_ip);
+int		nsm_unmonitor(struct nlm_host *, __u32 *serv_ip);
 extern u32	nsm_local_state;
 
 #endif /* LINUX_LOCKD_SM_INTER_H */
--- linux-2.6.17-2/fs/lockd/svc4proc.c	2006-06-28 14:19:24.000000000 -0400
+++ linux-2.6.17-3/fs/lockd/svc4proc.c	2006-06-29 09:10:02.000000000 -0400
@@ -58,7 +58,7 @@ nlm4svc_retrieve_args(struct svc_rqst *r
 
 	/* Obtain host handle */
 	if (!(host = nlmsvc_lookup_host(rqstp))
-	 || (argp->monitor && !host->h_monitored && nsm_monitor(host) < 0))
+	 || (argp->monitor && !host->h_monitored && nsm_monitor(host, &rqstp->rq_daddr) < 0))
 		goto no_locks;
 	*hostp = host;
 
--- linux-2.6.17-2/fs/lockd/svcproc.c	2006-06-28 14:19:50.000000000 -0400
+++ linux-2.6.17-3/fs/lockd/svcproc.c	2006-06-29 09:10:02.000000000 -0400
@@ -89,7 +89,7 @@ nlmsvc_retrieve_args(struct svc_rqst *rq
 
 	/* Obtain host handle */
 	if (!(host = nlmsvc_lookup_host(rqstp))
-	 || (argp->monitor && !host->h_monitored && nsm_monitor(host) < 0))
+	 || (argp->monitor && !host->h_monitored && nsm_monitor(host, &rqstp->rq_daddr) < 0))
 		goto no_locks;
 	*hostp = host;
 
--- linux-2.6.17-2/fs/lockd/clntproc.c	2006-06-27 22:49:16.000000000 -0400
+++ linux-2.6.17-3/fs/lockd/clntproc.c	2006-06-29 09:10:02.000000000 -0400
@@ -501,7 +501,7 @@ nlmclnt_lock(struct nlm_rqst *req, struc
 	struct nlm_wait *block = NULL;
 	int status = -ENOLCK;
 
-	if (!host->h_monitored && nsm_monitor(host) < 0) {
+	if (!host->h_monitored && nsm_monitor(host,NULL) < 0) {
 		printk(KERN_NOTICE "lockd: failed to monitor %s\n",
 					host->h_name);
 		goto out;
--- linux-2.6.17-2/fs/lockd/mon.c	2006-06-27 22:49:16.000000000 -0400
+++ linux-2.6.17-3/fs/lockd/mon.c	2006-06-29 09:21:03.000000000 -0400
@@ -14,7 +14,6 @@
 #include <linux/lockd/lockd.h>
 #include <linux/lockd/sm_inter.h>
 
-
 #define NLMDBG_FACILITY		NLMDBG_MONITOR
 
 static struct rpc_clnt *	nsm_create(void);
@@ -30,7 +29,7 @@ u32				nsm_local_state;
  * Common procedure for SM_MON/SM_UNMON calls
  */
 static int
-nsm_mon_unmon(struct nlm_host *host, u32 proc, struct nsm_res *res)
+nsm_mon_unmon(struct nlm_host *host, __u32 *serv_ip, u32 proc, struct nsm_res *res)
 {
 	struct rpc_clnt	*clnt;
 	int		status;
@@ -47,6 +46,7 @@ nsm_mon_unmon(struct nlm_host *host, u32
 	}
 
 	args.addr = host->h_addr.sin_addr.s_addr;
+	args.serv = *serv_ip;
 	args.proto= (host->h_proto<<1) | host->h_server;
 	args.prog = NLM_PROGRAM;
 	args.vers = host->h_version;
@@ -68,14 +68,14 @@ nsm_mon_unmon(struct nlm_host *host, u32
  * Set up monitoring of a remote host
  */
 int
-nsm_monitor(struct nlm_host *host)
+nsm_monitor(struct nlm_host *host, __u32 *serv_ip)
 {
 	struct nsm_res	res;
 	int		status;
 
 	dprintk("lockd: nsm_monitor(%s)\n", host->h_name);
 
-	status = nsm_mon_unmon(host, SM_MON, &res);
+	status = nsm_mon_unmon(host, serv_ip, SM_MON, &res);
 
 	if (status < 0 || res.status != 0)
 		printk(KERN_NOTICE "lockd: cannot monitor %s\n", host->h_name);
@@ -88,14 +88,14 @@ nsm_monitor(struct nlm_host *host)
  * Cease to monitor remote host
  */
 int
-nsm_unmonitor(struct nlm_host *host)
+nsm_unmonitor(struct nlm_host *host, __u32 *serv_ip)
 {
 	struct nsm_res	res;
 	int		status;
 
 	dprintk("lockd: nsm_unmonitor(%s)\n", host->h_name);
 
-	status = nsm_mon_unmon(host, SM_UNMON, &res);
+	status = nsm_mon_unmon(host, serv_ip, SM_UNMON, &res);
 	if (status < 0)
 		printk(KERN_NOTICE "lockd: cannot unmonitor %s\n", host->h_name);
 	else
@@ -151,8 +151,13 @@ xdr_encode_common(struct rpc_rqst *rqstp
 	 * so this works alright.
 	 */
 	sprintf(buffer, "%u.%u.%u.%u", NIPQUAD(argp->addr));
-	if (!(p = xdr_encode_string(p, buffer))
-	 || !(p = xdr_encode_string(p, system_utsname.nodename)))
+	if (!(p = xdr_encode_string(p, buffer)))
+		return ERR_PTR(-EIO);
+	if (argp->serv) 
+		sprintf(buffer, "%u.%u.%u.%u", NIPQUAD(argp->serv));
+	else 
+		sprintf(buffer, "%s", system_utsname.nodename);
+	if (!(p = xdr_encode_string(p, buffer)))
 		return ERR_PTR(-EIO);
 	*p++ = htonl(argp->prog);
 	*p++ = htonl(argp->vers);
--- linux-2.6.17-2/fs/lockd/host.c	2006-06-27 22:49:14.000000000 -0400
+++ linux-2.6.17-3/fs/lockd/host.c	2006-06-29 09:10:02.000000000 -0400
@@ -329,7 +329,7 @@ nlm_gc_hosts(void)
 			*q = host->h_next;
 			/* Don't unmonitor hosts that have been invalidated */
 			if (host->h_monitored && !host->h_killed)
-				nsm_unmonitor(host);
+				nsm_unmonitor(host, NULL);
 			if ((clnt = host->h_rpcclnt) != NULL) {
 				if (atomic_read(&clnt->cl_users)) {
 					printk(KERN_WARNING

[-- Attachment #3: Type: text/plain, Size: 299 bytes --]

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

[-- Attachment #4: Type: text/plain, Size: 140 bytes --]

_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

             reply	other threads:[~2006-06-29 18:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-29 18:35 Wendy Cheng [this message]
2006-06-29 18:35 ` [RFC PATCH 3/3] NLM lock failover = statd enablement Wendy Cheng

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=44A41D78.5000201@redhat.com \
    --to=wcheng@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.