All of lore.kernel.org
 help / color / mirror / Atom feed
diff for duplicates of <46156FA0.4030506@redhat.com>

diff --git a/a/1.txt b/N1/1.txt
index b184ec2..28b3274 100644
--- a/a/1.txt
+++ b/N1/1.txt
@@ -12,11 +12,3 @@ loopback address (127.0.0.1), regardless the statement made in rpc.statd
 man page. Check out "man rpc.statd" and "man sm-notify" for details.
 
 -- Wendy
-
--------------- next part --------------
-A non-text attachment was scrubbed...
-Name: 003_nlm_statd.patch
-Type: text/x-patch
-Size: 14486 bytes
-Desc: not available
-URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20070405/7f776025/attachment.bin>
diff --git a/N1/2.hdr b/N1/2.hdr
new file mode 100644
index 0000000..86de521
--- /dev/null
+++ b/N1/2.hdr
@@ -0,0 +1,5 @@
+Content-Type: text/x-patch;
+ name="003_nlm_statd.patch"
+Content-Transfer-Encoding: 7bit
+Content-Disposition: inline;
+ filename="003_nlm_statd.patch"
diff --git a/N1/2.txt b/N1/2.txt
new file mode 100644
index 0000000..6e36cae
--- /dev/null
+++ b/N1/2.txt
@@ -0,0 +1,488 @@
+Signed-off-by: S. Wendy Cheng <wcheng@redhat.com>
+Signed-off-by: Lon Hohberger  <lhh@redhat.com>
+
+ fs/lockd/clntproc.c            |    2 
+ fs/lockd/host.c                |   61 +++++++++++++++++++-----
+ fs/lockd/mon.c                 |  104 +++++++++++++++++++++++++++++++++++------
+ include/linux/lockd/lockd.h    |   11 +++-
+ include/linux/lockd/sm_inter.h |    3 -
+ net/sunrpc/svcsock.c           |   40 +++++++++++++++
+ 6 files changed, 191 insertions(+), 30 deletions(-)
+
+--- linux-nlm-2/include/linux/lockd/sm_inter.h	2007-03-26 18:25:38.000000000 -0400
++++ linux/include/linux/lockd/sm_inter.h	2007-04-03 21:55:42.000000000 -0400
+@@ -25,6 +25,7 @@
+  */
+ struct nsm_args {
+ 	__be32		addr;		/* remote address */
++	__be32          serv;		/* server ip address */
+ 	u32		prog;		/* RPC callback info */
+ 	u32		vers;
+ 	u32		proc;
+@@ -40,7 +41,7 @@ struct nsm_res {
+ 	u32		state;
+ };
+ 
+-int		nsm_monitor(struct nlm_host *);
++int		nsm_monitor(struct nlm_host *, __be32 ip);
+ int		nsm_unmonitor(struct nlm_host *);
+ extern int	nsm_local_state;
+ 
+--- linux-nlm-2/include/linux/lockd/lockd.h	2007-03-26 18:25:38.000000000 -0400
++++ linux/include/linux/lockd/lockd.h	2007-04-04 10:45:14.000000000 -0400
+@@ -39,12 +39,12 @@
+ struct nlm_host {
+ 	struct hlist_node	h_hash;		/* doubly linked list */
+ 	struct sockaddr_in	h_addr;		/* peer address */
++	__be32			h_server;	/* server ip for NLM failover */
+ 	struct rpc_clnt	*	h_rpcclnt;	/* RPC client to talk to peer */
+ 	char *			h_name;		/* remote hostname */
+ 	u32			h_version;	/* interface version */
+ 	unsigned short		h_proto;	/* transport proto */
+ 	unsigned short		h_reclaiming : 1,
+-				h_server     : 1, /* server side, not client side */
+ 				h_inuse      : 1;
+ 	wait_queue_head_t	h_gracewait;	/* wait while reclaiming */
+ 	struct rw_semaphore	h_rwsem;	/* Reboot recovery lock */
+@@ -62,11 +62,18 @@ struct nlm_host {
+ 	struct nsm_handle *	h_nsmhandle;	/* NSM status handle */
+ };
+ 
++struct nsm_fo_monitored {
++	struct list_head	list;
++	__be32			addr;
++};
++
+ struct nsm_handle {
+ 	struct list_head	sm_link;
+ 	atomic_t		sm_count;
+ 	char *			sm_name;
+ 	struct sockaddr_in	sm_addr;
++	struct mutex		sm_mutex;
++	struct nsm_fo_monitored sm_serverip;
+ 	unsigned int		sm_monitored : 1,
+ 				sm_sticky : 1;	/* don't unmonitor */
+ };
+@@ -254,7 +261,7 @@ static inline int
+ nlmsvc_check_grace_period(struct nlm_args *argp)
+ {
+ 	/* check for system wide grace period */
+-	if (nlmsvc_grace_period)
++	if (nlmsvc_grace_period) 
+ 		return 1;
+ 
+ 	/* check for per exported fsid grace period */
+--- linux-nlm-2/net/sunrpc/svcsock.c	2007-03-26 18:26:06.000000000 -0400
++++ linux/net/sunrpc/svcsock.c	2007-04-04 17:09:15.000000000 -0400
+@@ -1111,6 +1111,44 @@ failed:
+ 	return;
+ }
+ 
++/* Added for NLM-cluster failover implementation */ 
++static inline void svc_tcp_get_server_address(struct svc_rqst *rqstp)
++{
++	struct socket *sock = rqstp->rq_sock->sk_sock;
++	struct sockaddr_in6 sin6;
++	struct sockaddr_in *sin = (struct sockaddr_in *) &sin6;
++	int len, err;
++
++	/* ref: inet_getname, inet6_getname, and sys_getsockname */
++	err = sock->ops->getname(sock, (struct sockaddr *) sin, &len, 0);
++	if (err) {
++		dprintk("svc_tcp_get_server_address: getname err=%d\n", err);
++		return;
++	}
++		
++        switch (rqstp->rq_sock->sk_sk->sk_family) {
++        case AF_INET: 
++		/* sanity check */
++		if (sin->sin_family != AF_INET)
++			printk("sunrpc: inet address family mismatch %d\n",
++				(int) sin->sin_family); 
++                rqstp->rq_daddr.addr = sin->sin_addr;
++                break;
++        case AF_INET6: 
++		/* sanity check */
++		if (sin6.sin6_family != AF_INET6)
++			printk("sunrpc: inet6 address family mismatch %d\n",
++				(int) sin6.sin6_family); 
++                ipv6_addr_copy(&rqstp->rq_daddr.addr6, &sin6.sin6_addr); 
++                break;
++	default:
++		break;
++	}
++
++	/* no error return */
++	return;
++}
++
+ /*
+  * Receive data from a TCP socket.
+  */
+@@ -1260,6 +1298,8 @@ svc_tcp_recvfrom(struct svc_rqst *rqstp)
+ 	if (serv->sv_stats)
+ 		serv->sv_stats->nettcpcnt++;
+ 
++	svc_tcp_get_server_address(rqstp);
++
+ 	return len;
+ 
+  err_delete:
+--- linux-nlm-2/fs/lockd/host.c	2007-03-26 18:19:11.000000000 -0400
++++ linux/fs/lockd/host.c	2007-04-04 12:02:50.000000000 -0400
+@@ -34,16 +34,16 @@ static DEFINE_MUTEX(nlm_host_mutex);
+ 
+ static void			nlm_gc_hosts(void);
+ static struct nsm_handle *	__nsm_find(const struct sockaddr_in *,
+-					const char *, int, int);
++					const char *, int, int, __be32);
+ static struct nsm_handle *	nsm_find(const struct sockaddr_in *sin,
+ 					 const char *hostname,
+-					 int hostname_len);
++					 int hostname_len, __be32 ip);
+ 
+ /*
+  * Common host lookup routine for server & client
+  */
+ static struct nlm_host *
+-nlm_lookup_host(int server, const struct sockaddr_in *sin,
++nlm_lookup_host(union svc_addr_u *server, const struct sockaddr_in *sin,
+ 					int proto, int version,
+ 					const char *hostname,
+ 					int hostname_len)
+@@ -53,6 +53,7 @@ nlm_lookup_host(int server, const struct
+ 	struct nlm_host	*host;
+ 	struct nsm_handle *nsm = NULL;
+ 	int		hash;
++	__be32		server_ip;
+ 
+ 	dprintk("lockd: nlm_lookup_host(%u.%u.%u.%u, p=%d, v=%d, my role=%s, name=%.*s)\n",
+ 			NIPQUAD(sin->sin_addr.s_addr), proto, version,
+@@ -60,6 +61,13 @@ nlm_lookup_host(int server, const struct
+ 			hostname_len,
+ 			hostname? hostname : "<none>");
+ 
++	/* NLM failover: ipv4 for now */
++	if (server)
++		server_ip = server->addr.s_addr;
++	else
++		server_ip = 0;
++
++	dprintk("lockd: server_ip = %u.%u.%u.%u\n", NIPQUAD(server_ip));
+ 
+ 	hash = NLM_ADDRHASH(sin->sin_addr.s_addr);
+ 
+@@ -89,7 +97,7 @@ nlm_lookup_host(int server, const struct
+ 			continue;
+ 		if (host->h_version != version)
+ 			continue;
+-		if (host->h_server != server)
++		if (host->h_server != server_ip)
+ 			continue;
+ 
+ 		/* Move to head of hash chain. */
+@@ -107,7 +115,7 @@ nlm_lookup_host(int server, const struct
+ 	/* Sadly, the host isn't in our hash table yet. See if
+ 	 * we have an NSM handle for it. If not, create one.
+ 	 */
+-	if (!nsm && !(nsm = nsm_find(sin, hostname, hostname_len)))
++	if (!nsm && !(nsm = nsm_find(sin, hostname, hostname_len, server_ip)))
+ 		goto out;
+ 
+ 	host = kzalloc(sizeof(*host), GFP_KERNEL);
+@@ -130,7 +138,10 @@ nlm_lookup_host(int server, const struct
+ 	host->h_state      = 0;			/* pseudo NSM state */
+ 	host->h_nsmstate   = 0;			/* real NSM state */
+ 	host->h_nsmhandle  = nsm;
+-	host->h_server	   = server;
++
++	/* NLM failover: only ipv4 for now */
++	host->h_server	   = server_ip;
++
+ 	hlist_add_head(&host->h_hash, chain);
+ 	INIT_LIST_HEAD(&host->h_lockowners);
+ 	spin_lock_init(&host->h_lock);
+@@ -180,7 +191,7 @@ struct nlm_host *
+ nlmclnt_lookup_host(const struct sockaddr_in *sin, int proto, int version,
+ 			const char *hostname, int hostname_len)
+ {
+-	return nlm_lookup_host(0, sin, proto, version,
++	return nlm_lookup_host(NULL, sin, proto, version,
+ 			       hostname, hostname_len);
+ }
+ 
+@@ -191,7 +202,7 @@ struct nlm_host *
+ nlmsvc_lookup_host(struct svc_rqst *rqstp,
+ 			const char *hostname, int hostname_len)
+ {
+-	return nlm_lookup_host(1, svc_addr_in(rqstp),
++	return nlm_lookup_host(&rqstp->rq_daddr, svc_addr_in(rqstp),
+ 			       rqstp->rq_prot, rqstp->rq_vers,
+ 			       hostname, hostname_len);
+ }
+@@ -314,7 +325,7 @@ void nlm_host_rebooted(const struct sock
+ 			hostname, NIPQUAD(sin->sin_addr));
+ 
+ 	/* Find the NSM handle for this peer */
+-	if (!(nsm = __nsm_find(sin, hostname, hostname_len, 0)))
++	if (!(nsm = __nsm_find(sin, hostname, hostname_len, 0, 0)))
+ 		return;
+ 
+ 	/* When reclaiming locks on this peer, make sure that
+@@ -445,7 +456,7 @@ static DEFINE_MUTEX(nsm_mutex);
+ static struct nsm_handle *
+ __nsm_find(const struct sockaddr_in *sin,
+ 		const char *hostname, int hostname_len,
+-		int create)
++		int create, __be32 server_ip)
+ {
+ 	struct nsm_handle *nsm = NULL;
+ 	struct list_head *pos;
+@@ -490,6 +501,11 @@ __nsm_find(const struct sockaddr_in *sin
+ 		atomic_set(&nsm->sm_count, 1);
+ 
+ 		list_add(&nsm->sm_link, &nsm_handles);
++
++		/* NLM failover */
++		mutex_init(&nsm->sm_mutex);
++		INIT_LIST_HEAD(&nsm->sm_serverip.list);
++		nsm->sm_serverip.addr = server_ip;
+ 	}
+ 
+ out:
+@@ -498,9 +514,28 @@ out:
+ }
+ 
+ static struct nsm_handle *
+-nsm_find(const struct sockaddr_in *sin, const char *hostname, int hostname_len)
++nsm_find(const struct sockaddr_in *sin, const char *hostname, int hostname_len,
++		__be32 server_ip)
++{
++	return __nsm_find(sin, hostname, hostname_len, 1, server_ip);
++}
++
++/*
++ * NLM failover:
++ *	nsm_mutex should be obtained before entry
++ *	fo_ip not NULL
++ */
++void
++nsm_release_fo_ip(struct nsm_fo_monitored *fo_ip)
+ {
+-	return __nsm_find(sin, hostname, hostname_len, 1);
++	struct list_head *pos, *n, *head=&fo_ip->list;
++	struct nsm_fo_monitored *server_ip;
++
++	list_for_each_safe(pos, n, head) {
++		server_ip = list_entry(pos, struct nsm_fo_monitored, list);
++		kfree(server_ip);
++	}
++	return;
+ }
+ 
+ /*
+@@ -515,6 +550,8 @@ nsm_release(struct nsm_handle *nsm)
+ 		mutex_lock(&nsm_mutex);
+ 		if (atomic_read(&nsm->sm_count) == 0) {
+ 			list_del(&nsm->sm_link);
++			if (!list_empty(&nsm->sm_serverip.list))
++				nsm_release_fo_ip(&nsm->sm_serverip);
+ 			kfree(nsm);
+ 		}
+ 		mutex_unlock(&nsm_mutex);
+--- linux-nlm-2/fs/lockd/mon.c	2007-03-26 18:19:10.000000000 -0400
++++ linux/fs/lockd/mon.c	2007-04-04 16:11:05.000000000 -0400
+@@ -30,7 +30,7 @@ int				nsm_local_state;
+  * Common procedure for SM_MON/SM_UNMON calls
+  */
+ static int
+-nsm_mon_unmon(struct nsm_handle *nsm, u32 proc, struct nsm_res *res)
++nsm_mon_unmon(struct nsm_handle *nsm, u32 proc, struct nsm_res *res, __be32 server_ip)
+ {
+ 	struct rpc_clnt	*clnt;
+ 	int		status;
+@@ -48,6 +48,12 @@ nsm_mon_unmon(struct nsm_handle *nsm, u3
+ 
+ 	memset(&args, 0, sizeof(args));
+ 	args.mon_name = nsm->sm_name;
++
++	/* NLM failover:
++	 * only IPV4 is supported at this moment 
++	 */
++	args.serv = server_ip;
++
+ 	args.addr = nsm->sm_addr.sin_addr.s_addr;
+ 	args.prog = NLM_PROGRAM;
+ 	args.vers = 3;
+@@ -65,28 +71,71 @@ nsm_mon_unmon(struct nsm_handle *nsm, u3
+ 	return status;
+ }
+ 
++static inline
++int nsm_is_monitored(struct nlm_host *host, __be32 server)
++{
++	struct nsm_handle *nsm = host->h_nsmhandle;
++	struct list_head *pos, *head;
++	struct nsm_fo_monitored *fo_entry;
++
++	/* client */
++	if (!server)
++		return nsm->sm_monitored;
++
++	/* server */
++	if (!nsm->sm_monitored)
++		return 0;
++
++	/* search for monitored list */
++	mutex_lock(&nsm->sm_mutex);
++	head = &nsm->sm_serverip.list;
++	list_for_each(pos, head) {
++		fo_entry = list_entry(pos, struct nsm_fo_monitored, list);
++		if (fo_entry->addr == server) {
++			mutex_unlock(&nsm->sm_mutex);
++			return 1;
++		}
++	}
++	mutex_unlock(&nsm->sm_mutex);
++
++	return 0;
++}
++
+ /*
+  * Set up monitoring of a remote host
+  */
+ int
+-nsm_monitor(struct nlm_host *host)
++nsm_monitor(struct nlm_host *host, __be32 server)
+ {
+ 	struct nsm_handle *nsm = host->h_nsmhandle;
+ 	struct nsm_res	res;
+ 	int		status;
++	struct nsm_fo_monitored *fo_entry;
+ 
+ 	dprintk("lockd: nsm_monitor(%s)\n", host->h_name);
+ 	BUG_ON(nsm == NULL);
+ 
+-	if (nsm->sm_monitored)
++	if (nsm_is_monitored(host, server)) {
++		dprintk("nsm_monitor: sm_monitored is true - returning 0\n");
+ 		return 0;
++	}
+ 
+-	status = nsm_mon_unmon(nsm, SM_MON, &res);
++	status = nsm_mon_unmon(nsm, SM_MON, &res, server);
+ 
+ 	if (status < 0 || res.status != 0)
+ 		printk(KERN_NOTICE "lockd: cannot monitor %s\n", host->h_name);
+-	else
++	else if (nsm->sm_monitored) {
++		fo_entry = kzalloc(sizeof(struct nsm_fo_monitored), GFP_KERNEL);
++		if (!fo_entry) {
++			printk("lockd: out of memory, can't add fo_entry\n");
++			return -ENOMEM;
++		}
++		fo_entry->addr = server;
++		INIT_LIST_HEAD(&fo_entry->list);
++		list_add(&fo_entry->list, &nsm->sm_serverip.list);
++	} else
+ 		nsm->sm_monitored = 1;
++
+ 	return status;
+ }
+ 
+@@ -98,7 +147,9 @@ nsm_unmonitor(struct nlm_host *host)
+ {
+ 	struct nsm_handle *nsm = host->h_nsmhandle;
+ 	struct nsm_res	res;
+-	int		status = 0;
++	int		status = 0, error=0;
++	struct list_head *pos, *head=&nsm->sm_serverip.list;
++	struct nsm_fo_monitored *fo_entry;
+ 
+ 	if (nsm == NULL)
+ 		return 0;
+@@ -108,11 +159,21 @@ nsm_unmonitor(struct nlm_host *host)
+ 	 && nsm->sm_monitored && !nsm->sm_sticky) {
+ 		dprintk("lockd: nsm_unmonitor(%s)\n", host->h_name);
+ 
+-		status = nsm_mon_unmon(nsm, SM_UNMON, &res);
+-		if (status < 0)
+-			printk(KERN_NOTICE "lockd: cannot unmonitor %s\n",
++		/* Unmonitor each server IP 
++		 * 	todo: need to re-think error handling
++		 */
++		mutex_lock(&nsm->sm_mutex);
++		list_for_each(pos, head) {
++			fo_entry = list_entry(pos, struct nsm_fo_monitored, list);
++			status = nsm_mon_unmon(nsm, SM_UNMON, &res, fo_entry->addr);
++			if (status < 0) {
++				error++;
++				printk(KERN_NOTICE "lockd: cannot unmonitor %s\n",
+ 					host->h_name);
+-		else
++			} 
++		}
++		mutex_unlock(&nsm->sm_mutex);
++		if (!error)
+ 			nsm->sm_monitored = 0;
+ 	}
+ 	nsm_release(nsm);
+@@ -144,6 +205,13 @@ nsm_create(void)
+ 	return rpc_create(&args);
+ }
+ 
++/* We want "buffer" in xdr_encode_common() to hold
++ * either the system_utsname.nodename string (__NEW_UTS_LEN+1)
++ * or IPv4 dot notation (16 bytes+1) for now.
++ */
++
++#define        XDR_ENCODE_BUF_LEN __NEW_UTS_LEN+1
++
+ /*
+  * XDR functions for NSM.
+  */
+@@ -151,7 +219,8 @@ nsm_create(void)
+ static __be32 *
+ xdr_encode_common(struct rpc_rqst *rqstp, __be32 *p, struct nsm_args *argp)
+ {
+-	char	buffer[20], *name;
++	char	*name;
++	char    buffer[XDR_ENCODE_BUF_LEN];
+ 
+ 	/*
+ 	 * Use the dotted-quad IP address of the remote host as
+@@ -161,13 +230,20 @@ xdr_encode_common(struct rpc_rqst *rqstp
+ 	 */
+ 	if (nsm_use_hostnames) {
+ 		name = argp->mon_name;
+-	} else {
++	} else { 
+ 		sprintf(buffer, "%u.%u.%u.%u", NIPQUAD(argp->addr));
+ 		name = buffer;
+ 	}
+-	if (!(p = xdr_encode_string(p, name))
+-	 || !(p = xdr_encode_string(p, utsname()->nodename)))
++	if (!(p = xdr_encode_string(p, name)))
++		return ERR_PTR(-EIO);
++
++	if (argp->serv)
++		sprintf(buffer, "%u.%u.%u.%u", NIPQUAD(argp->serv));
++	else
++		sprintf(buffer, "%s", utsname()->nodename);
++	if (!(p = xdr_encode_string(p, buffer)))
+ 		return ERR_PTR(-EIO);
++
+ 	*p++ = htonl(argp->prog);
+ 	*p++ = htonl(argp->vers);
+ 	*p++ = htonl(argp->proc);
+--- linux-nlm-2/fs/lockd/clntproc.c	2007-03-26 18:19:10.000000000 -0400
++++ linux/fs/lockd/clntproc.c	2007-04-03 21:49:04.000000000 -0400
+@@ -500,7 +500,7 @@ nlmclnt_lock(struct nlm_rqst *req, struc
+ 	unsigned char fl_flags = fl->fl_flags;
+ 	int status = -ENOLCK;
+ 
+-	if (nsm_monitor(host) < 0) {
++	if (nsm_monitor(host, 0) < 0) {
+ 		printk(KERN_NOTICE "lockd: failed to monitor %s\n",
+ 					host->h_name);
+ 		goto out;
diff --git a/N1/3.hdr b/N1/3.hdr
new file mode 100644
index 0000000..4b86001
--- /dev/null
+++ b/N1/3.hdr
@@ -0,0 +1,4 @@
+Content-Type: text/plain; charset="us-ascii"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Disposition: inline
diff --git a/N1/3.txt b/N1/3.txt
new file mode 100644
index 0000000..f9179f9
--- /dev/null
+++ b/N1/3.txt
@@ -0,0 +1,5 @@
+-------------------------------------------------------------------------
+Take Surveys. Earn Cash. Influence the Future of IT
+Join SourceForge.net's Techsay panel and you'll get the chance to share your
+opinions on IT & business topics through brief surveys-and earn cash
+http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
diff --git a/N1/4.hdr b/N1/4.hdr
new file mode 100644
index 0000000..4b86001
--- /dev/null
+++ b/N1/4.hdr
@@ -0,0 +1,4 @@
+Content-Type: text/plain; charset="us-ascii"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Disposition: inline
diff --git a/N1/4.txt b/N1/4.txt
new file mode 100644
index 0000000..5264bf8
--- /dev/null
+++ b/N1/4.txt
@@ -0,0 +1,3 @@
+_______________________________________________
+NFS maillist  -  NFS@lists.sourceforge.net
+https://lists.sourceforge.net/lists/listinfo/nfs
diff --git a/a/content_digest b/N1/content_digest
index 9051f9f..f7d9415 100644
--- a/a/content_digest
+++ b/N1/content_digest
@@ -1,8 +1,10 @@
  "From\0Wendy Cheng <wcheng@redhat.com>\0"
- "Subject\0[Cluster-devel] [PATCH 3/4 Revised] NLM - kernel lockd-statd changes\0"
+ "Subject\0[PATCH 3/4 Revised] NLM - kernel lockd-statd changes\0"
  "Date\0Thu, 05 Apr 2007 17:52:32 -0400\0"
- "To\0cluster-devel.redhat.com\0"
- "\00:1\0"
+ "To\0nfs@lists.sourceforge.net"
+ " cluster-devel@redhat.com\0"
+ "Cc\0Lon Hohberger <lhh@redhat.com>\0"
+ "\01:1\0"
  "b\0"
  "This kernel patch (based on 2.6.21-rc4) should be paired with nfs-utils \n"
  "user mode changes (patch 4-4, based on nfs-utils-1.1.0-rc1) that is \n"
@@ -17,14 +19,509 @@
  "loopback address (127.0.0.1), regardless the statement made in rpc.statd \n"
  "man page. Check out \"man rpc.statd\" and \"man sm-notify\" for details.\n"
  "\n"
- "-- Wendy\n"
+ -- Wendy
+ "\01:2\0"
+ "fn\0003_nlm_statd.patch\0"
+ "b\0"
+ "Signed-off-by: S. Wendy Cheng <wcheng@redhat.com>\n"
+ "Signed-off-by: Lon Hohberger  <lhh@redhat.com>\n"
+ "\n"
+ " fs/lockd/clntproc.c            |    2 \n"
+ " fs/lockd/host.c                |   61 +++++++++++++++++++-----\n"
+ " fs/lockd/mon.c                 |  104 +++++++++++++++++++++++++++++++++++------\n"
+ " include/linux/lockd/lockd.h    |   11 +++-\n"
+ " include/linux/lockd/sm_inter.h |    3 -\n"
+ " net/sunrpc/svcsock.c           |   40 +++++++++++++++\n"
+ " 6 files changed, 191 insertions(+), 30 deletions(-)\n"
  "\n"
- "-------------- next part --------------\n"
- "A non-text attachment was scrubbed...\n"
- "Name: 003_nlm_statd.patch\n"
- "Type: text/x-patch\n"
- "Size: 14486 bytes\n"
- "Desc: not available\n"
- URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20070405/7f776025/attachment.bin>
+ "--- linux-nlm-2/include/linux/lockd/sm_inter.h\t2007-03-26 18:25:38.000000000 -0400\n"
+ "+++ linux/include/linux/lockd/sm_inter.h\t2007-04-03 21:55:42.000000000 -0400\n"
+ "@@ -25,6 +25,7 @@\n"
+ "  */\n"
+ " struct nsm_args {\n"
+ " \t__be32\t\taddr;\t\t/* remote address */\n"
+ "+\t__be32          serv;\t\t/* server ip address */\n"
+ " \tu32\t\tprog;\t\t/* RPC callback info */\n"
+ " \tu32\t\tvers;\n"
+ " \tu32\t\tproc;\n"
+ "@@ -40,7 +41,7 @@ struct nsm_res {\n"
+ " \tu32\t\tstate;\n"
+ " };\n"
+ " \n"
+ "-int\t\tnsm_monitor(struct nlm_host *);\n"
+ "+int\t\tnsm_monitor(struct nlm_host *, __be32 ip);\n"
+ " int\t\tnsm_unmonitor(struct nlm_host *);\n"
+ " extern int\tnsm_local_state;\n"
+ " \n"
+ "--- linux-nlm-2/include/linux/lockd/lockd.h\t2007-03-26 18:25:38.000000000 -0400\n"
+ "+++ linux/include/linux/lockd/lockd.h\t2007-04-04 10:45:14.000000000 -0400\n"
+ "@@ -39,12 +39,12 @@\n"
+ " struct nlm_host {\n"
+ " \tstruct hlist_node\th_hash;\t\t/* doubly linked list */\n"
+ " \tstruct sockaddr_in\th_addr;\t\t/* peer address */\n"
+ "+\t__be32\t\t\th_server;\t/* server ip for NLM failover */\n"
+ " \tstruct rpc_clnt\t*\th_rpcclnt;\t/* RPC client to talk to peer */\n"
+ " \tchar *\t\t\th_name;\t\t/* remote hostname */\n"
+ " \tu32\t\t\th_version;\t/* interface version */\n"
+ " \tunsigned short\t\th_proto;\t/* transport proto */\n"
+ " \tunsigned short\t\th_reclaiming : 1,\n"
+ "-\t\t\t\th_server     : 1, /* server side, not client side */\n"
+ " \t\t\t\th_inuse      : 1;\n"
+ " \twait_queue_head_t\th_gracewait;\t/* wait while reclaiming */\n"
+ " \tstruct rw_semaphore\th_rwsem;\t/* Reboot recovery lock */\n"
+ "@@ -62,11 +62,18 @@ struct nlm_host {\n"
+ " \tstruct nsm_handle *\th_nsmhandle;\t/* NSM status handle */\n"
+ " };\n"
+ " \n"
+ "+struct nsm_fo_monitored {\n"
+ "+\tstruct list_head\tlist;\n"
+ "+\t__be32\t\t\taddr;\n"
+ "+};\n"
+ "+\n"
+ " struct nsm_handle {\n"
+ " \tstruct list_head\tsm_link;\n"
+ " \tatomic_t\t\tsm_count;\n"
+ " \tchar *\t\t\tsm_name;\n"
+ " \tstruct sockaddr_in\tsm_addr;\n"
+ "+\tstruct mutex\t\tsm_mutex;\n"
+ "+\tstruct nsm_fo_monitored sm_serverip;\n"
+ " \tunsigned int\t\tsm_monitored : 1,\n"
+ " \t\t\t\tsm_sticky : 1;\t/* don't unmonitor */\n"
+ " };\n"
+ "@@ -254,7 +261,7 @@ static inline int\n"
+ " nlmsvc_check_grace_period(struct nlm_args *argp)\n"
+ " {\n"
+ " \t/* check for system wide grace period */\n"
+ "-\tif (nlmsvc_grace_period)\n"
+ "+\tif (nlmsvc_grace_period) \n"
+ " \t\treturn 1;\n"
+ " \n"
+ " \t/* check for per exported fsid grace period */\n"
+ "--- linux-nlm-2/net/sunrpc/svcsock.c\t2007-03-26 18:26:06.000000000 -0400\n"
+ "+++ linux/net/sunrpc/svcsock.c\t2007-04-04 17:09:15.000000000 -0400\n"
+ "@@ -1111,6 +1111,44 @@ failed:\n"
+ " \treturn;\n"
+ " }\n"
+ " \n"
+ "+/* Added for NLM-cluster failover implementation */ \n"
+ "+static inline void svc_tcp_get_server_address(struct svc_rqst *rqstp)\n"
+ "+{\n"
+ "+\tstruct socket *sock = rqstp->rq_sock->sk_sock;\n"
+ "+\tstruct sockaddr_in6 sin6;\n"
+ "+\tstruct sockaddr_in *sin = (struct sockaddr_in *) &sin6;\n"
+ "+\tint len, err;\n"
+ "+\n"
+ "+\t/* ref: inet_getname, inet6_getname, and sys_getsockname */\n"
+ "+\terr = sock->ops->getname(sock, (struct sockaddr *) sin, &len, 0);\n"
+ "+\tif (err) {\n"
+ "+\t\tdprintk(\"svc_tcp_get_server_address: getname err=%d\\n\", err);\n"
+ "+\t\treturn;\n"
+ "+\t}\n"
+ "+\t\t\n"
+ "+        switch (rqstp->rq_sock->sk_sk->sk_family) {\n"
+ "+        case AF_INET: \n"
+ "+\t\t/* sanity check */\n"
+ "+\t\tif (sin->sin_family != AF_INET)\n"
+ "+\t\t\tprintk(\"sunrpc: inet address family mismatch %d\\n\",\n"
+ "+\t\t\t\t(int) sin->sin_family); \n"
+ "+                rqstp->rq_daddr.addr = sin->sin_addr;\n"
+ "+                break;\n"
+ "+        case AF_INET6: \n"
+ "+\t\t/* sanity check */\n"
+ "+\t\tif (sin6.sin6_family != AF_INET6)\n"
+ "+\t\t\tprintk(\"sunrpc: inet6 address family mismatch %d\\n\",\n"
+ "+\t\t\t\t(int) sin6.sin6_family); \n"
+ "+                ipv6_addr_copy(&rqstp->rq_daddr.addr6, &sin6.sin6_addr); \n"
+ "+                break;\n"
+ "+\tdefault:\n"
+ "+\t\tbreak;\n"
+ "+\t}\n"
+ "+\n"
+ "+\t/* no error return */\n"
+ "+\treturn;\n"
+ "+}\n"
+ "+\n"
+ " /*\n"
+ "  * Receive data from a TCP socket.\n"
+ "  */\n"
+ "@@ -1260,6 +1298,8 @@ svc_tcp_recvfrom(struct svc_rqst *rqstp)\n"
+ " \tif (serv->sv_stats)\n"
+ " \t\tserv->sv_stats->nettcpcnt++;\n"
+ " \n"
+ "+\tsvc_tcp_get_server_address(rqstp);\n"
+ "+\n"
+ " \treturn len;\n"
+ " \n"
+ "  err_delete:\n"
+ "--- linux-nlm-2/fs/lockd/host.c\t2007-03-26 18:19:11.000000000 -0400\n"
+ "+++ linux/fs/lockd/host.c\t2007-04-04 12:02:50.000000000 -0400\n"
+ "@@ -34,16 +34,16 @@ static DEFINE_MUTEX(nlm_host_mutex);\n"
+ " \n"
+ " static void\t\t\tnlm_gc_hosts(void);\n"
+ " static struct nsm_handle *\t__nsm_find(const struct sockaddr_in *,\n"
+ "-\t\t\t\t\tconst char *, int, int);\n"
+ "+\t\t\t\t\tconst char *, int, int, __be32);\n"
+ " static struct nsm_handle *\tnsm_find(const struct sockaddr_in *sin,\n"
+ " \t\t\t\t\t const char *hostname,\n"
+ "-\t\t\t\t\t int hostname_len);\n"
+ "+\t\t\t\t\t int hostname_len, __be32 ip);\n"
+ " \n"
+ " /*\n"
+ "  * Common host lookup routine for server & client\n"
+ "  */\n"
+ " static struct nlm_host *\n"
+ "-nlm_lookup_host(int server, const struct sockaddr_in *sin,\n"
+ "+nlm_lookup_host(union svc_addr_u *server, const struct sockaddr_in *sin,\n"
+ " \t\t\t\t\tint proto, int version,\n"
+ " \t\t\t\t\tconst char *hostname,\n"
+ " \t\t\t\t\tint hostname_len)\n"
+ "@@ -53,6 +53,7 @@ nlm_lookup_host(int server, const struct\n"
+ " \tstruct nlm_host\t*host;\n"
+ " \tstruct nsm_handle *nsm = NULL;\n"
+ " \tint\t\thash;\n"
+ "+\t__be32\t\tserver_ip;\n"
+ " \n"
+ " \tdprintk(\"lockd: nlm_lookup_host(%u.%u.%u.%u, p=%d, v=%d, my role=%s, name=%.*s)\\n\",\n"
+ " \t\t\tNIPQUAD(sin->sin_addr.s_addr), proto, version,\n"
+ "@@ -60,6 +61,13 @@ nlm_lookup_host(int server, const struct\n"
+ " \t\t\thostname_len,\n"
+ " \t\t\thostname? hostname : \"<none>\");\n"
+ " \n"
+ "+\t/* NLM failover: ipv4 for now */\n"
+ "+\tif (server)\n"
+ "+\t\tserver_ip = server->addr.s_addr;\n"
+ "+\telse\n"
+ "+\t\tserver_ip = 0;\n"
+ "+\n"
+ "+\tdprintk(\"lockd: server_ip = %u.%u.%u.%u\\n\", NIPQUAD(server_ip));\n"
+ " \n"
+ " \thash = NLM_ADDRHASH(sin->sin_addr.s_addr);\n"
+ " \n"
+ "@@ -89,7 +97,7 @@ nlm_lookup_host(int server, const struct\n"
+ " \t\t\tcontinue;\n"
+ " \t\tif (host->h_version != version)\n"
+ " \t\t\tcontinue;\n"
+ "-\t\tif (host->h_server != server)\n"
+ "+\t\tif (host->h_server != server_ip)\n"
+ " \t\t\tcontinue;\n"
+ " \n"
+ " \t\t/* Move to head of hash chain. */\n"
+ "@@ -107,7 +115,7 @@ nlm_lookup_host(int server, const struct\n"
+ " \t/* Sadly, the host isn't in our hash table yet. See if\n"
+ " \t * we have an NSM handle for it. If not, create one.\n"
+ " \t */\n"
+ "-\tif (!nsm && !(nsm = nsm_find(sin, hostname, hostname_len)))\n"
+ "+\tif (!nsm && !(nsm = nsm_find(sin, hostname, hostname_len, server_ip)))\n"
+ " \t\tgoto out;\n"
+ " \n"
+ " \thost = kzalloc(sizeof(*host), GFP_KERNEL);\n"
+ "@@ -130,7 +138,10 @@ nlm_lookup_host(int server, const struct\n"
+ " \thost->h_state      = 0;\t\t\t/* pseudo NSM state */\n"
+ " \thost->h_nsmstate   = 0;\t\t\t/* real NSM state */\n"
+ " \thost->h_nsmhandle  = nsm;\n"
+ "-\thost->h_server\t   = server;\n"
+ "+\n"
+ "+\t/* NLM failover: only ipv4 for now */\n"
+ "+\thost->h_server\t   = server_ip;\n"
+ "+\n"
+ " \thlist_add_head(&host->h_hash, chain);\n"
+ " \tINIT_LIST_HEAD(&host->h_lockowners);\n"
+ " \tspin_lock_init(&host->h_lock);\n"
+ "@@ -180,7 +191,7 @@ struct nlm_host *\n"
+ " nlmclnt_lookup_host(const struct sockaddr_in *sin, int proto, int version,\n"
+ " \t\t\tconst char *hostname, int hostname_len)\n"
+ " {\n"
+ "-\treturn nlm_lookup_host(0, sin, proto, version,\n"
+ "+\treturn nlm_lookup_host(NULL, sin, proto, version,\n"
+ " \t\t\t       hostname, hostname_len);\n"
+ " }\n"
+ " \n"
+ "@@ -191,7 +202,7 @@ struct nlm_host *\n"
+ " nlmsvc_lookup_host(struct svc_rqst *rqstp,\n"
+ " \t\t\tconst char *hostname, int hostname_len)\n"
+ " {\n"
+ "-\treturn nlm_lookup_host(1, svc_addr_in(rqstp),\n"
+ "+\treturn nlm_lookup_host(&rqstp->rq_daddr, svc_addr_in(rqstp),\n"
+ " \t\t\t       rqstp->rq_prot, rqstp->rq_vers,\n"
+ " \t\t\t       hostname, hostname_len);\n"
+ " }\n"
+ "@@ -314,7 +325,7 @@ void nlm_host_rebooted(const struct sock\n"
+ " \t\t\thostname, NIPQUAD(sin->sin_addr));\n"
+ " \n"
+ " \t/* Find the NSM handle for this peer */\n"
+ "-\tif (!(nsm = __nsm_find(sin, hostname, hostname_len, 0)))\n"
+ "+\tif (!(nsm = __nsm_find(sin, hostname, hostname_len, 0, 0)))\n"
+ " \t\treturn;\n"
+ " \n"
+ " \t/* When reclaiming locks on this peer, make sure that\n"
+ "@@ -445,7 +456,7 @@ static DEFINE_MUTEX(nsm_mutex);\n"
+ " static struct nsm_handle *\n"
+ " __nsm_find(const struct sockaddr_in *sin,\n"
+ " \t\tconst char *hostname, int hostname_len,\n"
+ "-\t\tint create)\n"
+ "+\t\tint create, __be32 server_ip)\n"
+ " {\n"
+ " \tstruct nsm_handle *nsm = NULL;\n"
+ " \tstruct list_head *pos;\n"
+ "@@ -490,6 +501,11 @@ __nsm_find(const struct sockaddr_in *sin\n"
+ " \t\tatomic_set(&nsm->sm_count, 1);\n"
+ " \n"
+ " \t\tlist_add(&nsm->sm_link, &nsm_handles);\n"
+ "+\n"
+ "+\t\t/* NLM failover */\n"
+ "+\t\tmutex_init(&nsm->sm_mutex);\n"
+ "+\t\tINIT_LIST_HEAD(&nsm->sm_serverip.list);\n"
+ "+\t\tnsm->sm_serverip.addr = server_ip;\n"
+ " \t}\n"
+ " \n"
+ " out:\n"
+ "@@ -498,9 +514,28 @@ out:\n"
+ " }\n"
+ " \n"
+ " static struct nsm_handle *\n"
+ "-nsm_find(const struct sockaddr_in *sin, const char *hostname, int hostname_len)\n"
+ "+nsm_find(const struct sockaddr_in *sin, const char *hostname, int hostname_len,\n"
+ "+\t\t__be32 server_ip)\n"
+ "+{\n"
+ "+\treturn __nsm_find(sin, hostname, hostname_len, 1, server_ip);\n"
+ "+}\n"
+ "+\n"
+ "+/*\n"
+ "+ * NLM failover:\n"
+ "+ *\tnsm_mutex should be obtained before entry\n"
+ "+ *\tfo_ip not NULL\n"
+ "+ */\n"
+ "+void\n"
+ "+nsm_release_fo_ip(struct nsm_fo_monitored *fo_ip)\n"
+ " {\n"
+ "-\treturn __nsm_find(sin, hostname, hostname_len, 1);\n"
+ "+\tstruct list_head *pos, *n, *head=&fo_ip->list;\n"
+ "+\tstruct nsm_fo_monitored *server_ip;\n"
+ "+\n"
+ "+\tlist_for_each_safe(pos, n, head) {\n"
+ "+\t\tserver_ip = list_entry(pos, struct nsm_fo_monitored, list);\n"
+ "+\t\tkfree(server_ip);\n"
+ "+\t}\n"
+ "+\treturn;\n"
+ " }\n"
+ " \n"
+ " /*\n"
+ "@@ -515,6 +550,8 @@ nsm_release(struct nsm_handle *nsm)\n"
+ " \t\tmutex_lock(&nsm_mutex);\n"
+ " \t\tif (atomic_read(&nsm->sm_count) == 0) {\n"
+ " \t\t\tlist_del(&nsm->sm_link);\n"
+ "+\t\t\tif (!list_empty(&nsm->sm_serverip.list))\n"
+ "+\t\t\t\tnsm_release_fo_ip(&nsm->sm_serverip);\n"
+ " \t\t\tkfree(nsm);\n"
+ " \t\t}\n"
+ " \t\tmutex_unlock(&nsm_mutex);\n"
+ "--- linux-nlm-2/fs/lockd/mon.c\t2007-03-26 18:19:10.000000000 -0400\n"
+ "+++ linux/fs/lockd/mon.c\t2007-04-04 16:11:05.000000000 -0400\n"
+ "@@ -30,7 +30,7 @@ int\t\t\t\tnsm_local_state;\n"
+ "  * Common procedure for SM_MON/SM_UNMON calls\n"
+ "  */\n"
+ " static int\n"
+ "-nsm_mon_unmon(struct nsm_handle *nsm, u32 proc, struct nsm_res *res)\n"
+ "+nsm_mon_unmon(struct nsm_handle *nsm, u32 proc, struct nsm_res *res, __be32 server_ip)\n"
+ " {\n"
+ " \tstruct rpc_clnt\t*clnt;\n"
+ " \tint\t\tstatus;\n"
+ "@@ -48,6 +48,12 @@ nsm_mon_unmon(struct nsm_handle *nsm, u3\n"
+ " \n"
+ " \tmemset(&args, 0, sizeof(args));\n"
+ " \targs.mon_name = nsm->sm_name;\n"
+ "+\n"
+ "+\t/* NLM failover:\n"
+ "+\t * only IPV4 is supported at this moment \n"
+ "+\t */\n"
+ "+\targs.serv = server_ip;\n"
+ "+\n"
+ " \targs.addr = nsm->sm_addr.sin_addr.s_addr;\n"
+ " \targs.prog = NLM_PROGRAM;\n"
+ " \targs.vers = 3;\n"
+ "@@ -65,28 +71,71 @@ nsm_mon_unmon(struct nsm_handle *nsm, u3\n"
+ " \treturn status;\n"
+ " }\n"
+ " \n"
+ "+static inline\n"
+ "+int nsm_is_monitored(struct nlm_host *host, __be32 server)\n"
+ "+{\n"
+ "+\tstruct nsm_handle *nsm = host->h_nsmhandle;\n"
+ "+\tstruct list_head *pos, *head;\n"
+ "+\tstruct nsm_fo_monitored *fo_entry;\n"
+ "+\n"
+ "+\t/* client */\n"
+ "+\tif (!server)\n"
+ "+\t\treturn nsm->sm_monitored;\n"
+ "+\n"
+ "+\t/* server */\n"
+ "+\tif (!nsm->sm_monitored)\n"
+ "+\t\treturn 0;\n"
+ "+\n"
+ "+\t/* search for monitored list */\n"
+ "+\tmutex_lock(&nsm->sm_mutex);\n"
+ "+\thead = &nsm->sm_serverip.list;\n"
+ "+\tlist_for_each(pos, head) {\n"
+ "+\t\tfo_entry = list_entry(pos, struct nsm_fo_monitored, list);\n"
+ "+\t\tif (fo_entry->addr == server) {\n"
+ "+\t\t\tmutex_unlock(&nsm->sm_mutex);\n"
+ "+\t\t\treturn 1;\n"
+ "+\t\t}\n"
+ "+\t}\n"
+ "+\tmutex_unlock(&nsm->sm_mutex);\n"
+ "+\n"
+ "+\treturn 0;\n"
+ "+}\n"
+ "+\n"
+ " /*\n"
+ "  * Set up monitoring of a remote host\n"
+ "  */\n"
+ " int\n"
+ "-nsm_monitor(struct nlm_host *host)\n"
+ "+nsm_monitor(struct nlm_host *host, __be32 server)\n"
+ " {\n"
+ " \tstruct nsm_handle *nsm = host->h_nsmhandle;\n"
+ " \tstruct nsm_res\tres;\n"
+ " \tint\t\tstatus;\n"
+ "+\tstruct nsm_fo_monitored *fo_entry;\n"
+ " \n"
+ " \tdprintk(\"lockd: nsm_monitor(%s)\\n\", host->h_name);\n"
+ " \tBUG_ON(nsm == NULL);\n"
+ " \n"
+ "-\tif (nsm->sm_monitored)\n"
+ "+\tif (nsm_is_monitored(host, server)) {\n"
+ "+\t\tdprintk(\"nsm_monitor: sm_monitored is true - returning 0\\n\");\n"
+ " \t\treturn 0;\n"
+ "+\t}\n"
+ " \n"
+ "-\tstatus = nsm_mon_unmon(nsm, SM_MON, &res);\n"
+ "+\tstatus = nsm_mon_unmon(nsm, SM_MON, &res, server);\n"
+ " \n"
+ " \tif (status < 0 || res.status != 0)\n"
+ " \t\tprintk(KERN_NOTICE \"lockd: cannot monitor %s\\n\", host->h_name);\n"
+ "-\telse\n"
+ "+\telse if (nsm->sm_monitored) {\n"
+ "+\t\tfo_entry = kzalloc(sizeof(struct nsm_fo_monitored), GFP_KERNEL);\n"
+ "+\t\tif (!fo_entry) {\n"
+ "+\t\t\tprintk(\"lockd: out of memory, can't add fo_entry\\n\");\n"
+ "+\t\t\treturn -ENOMEM;\n"
+ "+\t\t}\n"
+ "+\t\tfo_entry->addr = server;\n"
+ "+\t\tINIT_LIST_HEAD(&fo_entry->list);\n"
+ "+\t\tlist_add(&fo_entry->list, &nsm->sm_serverip.list);\n"
+ "+\t} else\n"
+ " \t\tnsm->sm_monitored = 1;\n"
+ "+\n"
+ " \treturn status;\n"
+ " }\n"
+ " \n"
+ "@@ -98,7 +147,9 @@ nsm_unmonitor(struct nlm_host *host)\n"
+ " {\n"
+ " \tstruct nsm_handle *nsm = host->h_nsmhandle;\n"
+ " \tstruct nsm_res\tres;\n"
+ "-\tint\t\tstatus = 0;\n"
+ "+\tint\t\tstatus = 0, error=0;\n"
+ "+\tstruct list_head *pos, *head=&nsm->sm_serverip.list;\n"
+ "+\tstruct nsm_fo_monitored *fo_entry;\n"
+ " \n"
+ " \tif (nsm == NULL)\n"
+ " \t\treturn 0;\n"
+ "@@ -108,11 +159,21 @@ nsm_unmonitor(struct nlm_host *host)\n"
+ " \t && nsm->sm_monitored && !nsm->sm_sticky) {\n"
+ " \t\tdprintk(\"lockd: nsm_unmonitor(%s)\\n\", host->h_name);\n"
+ " \n"
+ "-\t\tstatus = nsm_mon_unmon(nsm, SM_UNMON, &res);\n"
+ "-\t\tif (status < 0)\n"
+ "-\t\t\tprintk(KERN_NOTICE \"lockd: cannot unmonitor %s\\n\",\n"
+ "+\t\t/* Unmonitor each server IP \n"
+ "+\t\t * \ttodo: need to re-think error handling\n"
+ "+\t\t */\n"
+ "+\t\tmutex_lock(&nsm->sm_mutex);\n"
+ "+\t\tlist_for_each(pos, head) {\n"
+ "+\t\t\tfo_entry = list_entry(pos, struct nsm_fo_monitored, list);\n"
+ "+\t\t\tstatus = nsm_mon_unmon(nsm, SM_UNMON, &res, fo_entry->addr);\n"
+ "+\t\t\tif (status < 0) {\n"
+ "+\t\t\t\terror++;\n"
+ "+\t\t\t\tprintk(KERN_NOTICE \"lockd: cannot unmonitor %s\\n\",\n"
+ " \t\t\t\t\thost->h_name);\n"
+ "-\t\telse\n"
+ "+\t\t\t} \n"
+ "+\t\t}\n"
+ "+\t\tmutex_unlock(&nsm->sm_mutex);\n"
+ "+\t\tif (!error)\n"
+ " \t\t\tnsm->sm_monitored = 0;\n"
+ " \t}\n"
+ " \tnsm_release(nsm);\n"
+ "@@ -144,6 +205,13 @@ nsm_create(void)\n"
+ " \treturn rpc_create(&args);\n"
+ " }\n"
+ " \n"
+ "+/* We want \"buffer\" in xdr_encode_common() to hold\n"
+ "+ * either the system_utsname.nodename string (__NEW_UTS_LEN+1)\n"
+ "+ * or IPv4 dot notation (16 bytes+1) for now.\n"
+ "+ */\n"
+ "+\n"
+ "+#define        XDR_ENCODE_BUF_LEN __NEW_UTS_LEN+1\n"
+ "+\n"
+ " /*\n"
+ "  * XDR functions for NSM.\n"
+ "  */\n"
+ "@@ -151,7 +219,8 @@ nsm_create(void)\n"
+ " static __be32 *\n"
+ " xdr_encode_common(struct rpc_rqst *rqstp, __be32 *p, struct nsm_args *argp)\n"
+ " {\n"
+ "-\tchar\tbuffer[20], *name;\n"
+ "+\tchar\t*name;\n"
+ "+\tchar    buffer[XDR_ENCODE_BUF_LEN];\n"
+ " \n"
+ " \t/*\n"
+ " \t * Use the dotted-quad IP address of the remote host as\n"
+ "@@ -161,13 +230,20 @@ xdr_encode_common(struct rpc_rqst *rqstp\n"
+ " \t */\n"
+ " \tif (nsm_use_hostnames) {\n"
+ " \t\tname = argp->mon_name;\n"
+ "-\t} else {\n"
+ "+\t} else { \n"
+ " \t\tsprintf(buffer, \"%u.%u.%u.%u\", NIPQUAD(argp->addr));\n"
+ " \t\tname = buffer;\n"
+ " \t}\n"
+ "-\tif (!(p = xdr_encode_string(p, name))\n"
+ "-\t || !(p = xdr_encode_string(p, utsname()->nodename)))\n"
+ "+\tif (!(p = xdr_encode_string(p, name)))\n"
+ "+\t\treturn ERR_PTR(-EIO);\n"
+ "+\n"
+ "+\tif (argp->serv)\n"
+ "+\t\tsprintf(buffer, \"%u.%u.%u.%u\", NIPQUAD(argp->serv));\n"
+ "+\telse\n"
+ "+\t\tsprintf(buffer, \"%s\", utsname()->nodename);\n"
+ "+\tif (!(p = xdr_encode_string(p, buffer)))\n"
+ " \t\treturn ERR_PTR(-EIO);\n"
+ "+\n"
+ " \t*p++ = htonl(argp->prog);\n"
+ " \t*p++ = htonl(argp->vers);\n"
+ " \t*p++ = htonl(argp->proc);\n"
+ "--- linux-nlm-2/fs/lockd/clntproc.c\t2007-03-26 18:19:10.000000000 -0400\n"
+ "+++ linux/fs/lockd/clntproc.c\t2007-04-03 21:49:04.000000000 -0400\n"
+ "@@ -500,7 +500,7 @@ nlmclnt_lock(struct nlm_rqst *req, struc\n"
+ " \tunsigned char fl_flags = fl->fl_flags;\n"
+ " \tint status = -ENOLCK;\n"
+ " \n"
+ "-\tif (nsm_monitor(host) < 0) {\n"
+ "+\tif (nsm_monitor(host, 0) < 0) {\n"
+ " \t\tprintk(KERN_NOTICE \"lockd: failed to monitor %s\\n\",\n"
+ " \t\t\t\t\thost->h_name);\n"
+ " \t\tgoto out;"
+ "\01:3\0"
+ "b\0"
+ "-------------------------------------------------------------------------\n"
+ "Take Surveys. Earn Cash. Influence the Future of IT\n"
+ "Join SourceForge.net's Techsay panel and you'll get the chance to share your\n"
+ "opinions on IT & business topics through brief surveys-and earn cash\n"
+ http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
+ "\01:4\0"
+ "b\0"
+ "_______________________________________________\n"
+ "NFS maillist  -  NFS@lists.sourceforge.net\n"
+ https://lists.sourceforge.net/lists/listinfo/nfs
 
-217fa95c7f40585667e267a07928badc353d68b6be0c904c3c19040ec696db34
+53efdd4e3ff4fa28383d57d2a63f64c4a511f35f6d3219647ff8ee6255fcfbca

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.