All of lore.kernel.org
 help / color / mirror / Atom feed
diff for duplicates of <4608474D.4030205@redhat.com>

diff --git a/a/1.txt b/N1/1.txt
index c1d56cf..f4058d9 100644
--- a/a/1.txt
+++ b/N1/1.txt
@@ -9,11 +9,3 @@ via echoing the NFS export filesystem id (fsid) into nfsd procfs entry as:
 shell> echo 1234 > /proc/fs/nfsd/nlm_set_grace_for_fsid
 
 -- Wendy
-
--------------- next part --------------
-A non-text attachment was scrubbed...
-Name: nlm_grace.patch
-Type: text/x-patch
-Size: 15229 bytes
-Desc: not available
-URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20070326/8b4c1701/attachment.bin>
diff --git a/N1/2.hdr b/N1/2.hdr
new file mode 100644
index 0000000..d1c5062
--- /dev/null
+++ b/N1/2.hdr
@@ -0,0 +1,5 @@
+Content-Type: text/x-patch;
+ name="nlm_grace.patch"
+Content-Transfer-Encoding: 7bit
+Content-Disposition: inline;
+ filename="nlm_grace.patch"
diff --git a/N1/2.txt b/N1/2.txt
new file mode 100644
index 0000000..8d50589
--- /dev/null
+++ b/N1/2.txt
@@ -0,0 +1,497 @@
+ Signed-off-by: S. Wendy Cheng <wcheng@redhat.com>
+ Signed-off-by: Lon Hohberger  <lhh@redhat.com>
+
+ fs/lockd/svc.c              |    8 +-
+ fs/lockd/svc4proc.c         |   15 ++-
+ fs/lockd/svcproc.c          |   12 +--
+ fs/lockd/svcsubs.c          |  169 ++++++++++++++++++++++++++++++++++++++++++++
+ fs/nfsd/nfsctl.c            |   27 +++++++
+ include/linux/lockd/bind.h  |    2
+ include/linux/lockd/lockd.h |   30 +++++++
+ 7 files changed, 248 insertions(+), 15 deletions(-)
+
+--- linux-nlm-1/include/linux/lockd/lockd.h	2007-03-26 10:29:44.000000000 -0400
++++ linux/include/linux/lockd/lockd.h	2007-03-26 17:37:39.000000000 -0400
+@@ -114,6 +114,16 @@ struct nlm_file {
+ 	struct mutex		f_mutex;	/* avoid concurrent access */
+ };
+ 
++#define NLM_FO_MAX_FSID_GP	127
++
++/* Server fsid linked list for NLM lock failover */
++struct fo_fsid {
++	struct list_head	g_list;		/* linked list */
++	unsigned long		g_expire;	/* when this grace period
++						 * will expire */
++	int			g_fsid;		/* exported fsid */
++};
++
+ /*
+  * This is a server block (i.e. a lock requested by some client which
+  * couldn't be granted because of a conflicting lock).
+@@ -193,6 +203,8 @@ void		  nlmsvc_traverse_blocks(struct nl
+ 					nlm_host_match_fn_t match);
+ void		  nlmsvc_grant_reply(struct nlm_cookie *, __be32);
+ 
++unsigned long set_grace_period(void); /*required by svcsubs.c and svc.c 
++					to support nlm failover */
+ /*
+  * File handling for the server personality
+  */
+@@ -204,6 +216,7 @@ void		  nlmsvc_free_host_resources(struc
+ void		  nlmsvc_invalidate_all(void);
+ int		  nlmsvc_same_fsid(struct nlm_host *, struct nlm_host *);
+ int		  nlmsvc_fo_unlock(int *fsid);
++int		  nlmsvc_fo_check(struct nfs_fh *fh);
+ 
+ static __inline__ struct inode *
+ nlmsvc_file_inode(struct nlm_file *file)
+@@ -234,6 +247,23 @@ nlm_compare_locks(const struct file_lock
+ 	     &&(fl1->fl_type  == fl2->fl_type || fl2->fl_type == F_UNLCK);
+ }
+ 
++extern struct list_head fo_fsid_list;
++
++/*Check for grace period: return TRUE or FALSE */
++static inline int
++nlmsvc_check_grace_period(struct nlm_args *argp)
++{
++	/* check for system wide grace period */
++	if (nlmsvc_grace_period)
++		return 1;
++
++	/* check for per exported fsid grace period */
++        if (unlikely(!list_empty(&fo_fsid_list)))
++                return(nlmsvc_fo_check(&argp->lock.fh));
++
++        return 0;
++}
++
+ extern struct lock_manager_operations nlmsvc_lock_operations;
+ 
+ #endif /* __KERNEL__ */
+--- linux-nlm-1/include/linux/lockd/bind.h	2007-03-26 10:29:44.000000000 -0400
++++ linux/include/linux/lockd/bind.h	2007-03-26 11:11:14.000000000 -0400
+@@ -38,5 +38,7 @@ extern int	nlmclnt_proc(struct inode *, 
+ extern int	lockd_up(int proto);
+ extern void	lockd_down(void);
+ extern int	nlmsvc_fo_unlock(int *fsid);
++extern int	nlmsvc_fo_setgrace(int fsid);
++extern void	nlmsvc_fo_reset_servs(void);
+ 
+ #endif /* LINUX_LOCKD_BIND_H */
+--- linux-nlm-1/fs/nfsd/nfsctl.c	2007-03-26 10:23:36.000000000 -0400
++++ linux/fs/nfsd/nfsctl.c	2007-03-26 15:40:12.000000000 -0400
+@@ -55,6 +55,7 @@ enum {
+ 	NFSD_List,
+ 	NFSD_Fh,
+ 	NFSD_NlmUnlock,
++	NFSD_NlmGrace,
+ 	NFSD_Threads,
+ 	NFSD_Pool_Threads,
+ 	NFSD_Versions,
+@@ -91,6 +92,8 @@ static ssize_t write_maxblksize(struct f
+ static ssize_t write_leasetime(struct file *file, char *buf, size_t size);
+ static ssize_t write_recoverydir(struct file *file, char *buf, size_t size);
+ #endif
++static ssize_t write_fo_unlock(struct file *file, char *buf, size_t size);
++static ssize_t write_fo_grace(struct file *file, char *buf, size_t size);
+ 
+ static ssize_t (*write_op[])(struct file *, char *, size_t) = {
+ 	[NFSD_Svc] = write_svc,
+@@ -102,6 +105,7 @@ static ssize_t (*write_op[])(struct file
+ 	[NFSD_Getfs] = write_getfs,
+ 	[NFSD_Fh] = write_filehandle,
+ 	[NFSD_NlmUnlock] = write_fo_unlock,
++	[NFSD_NlmGrace] = write_fo_grace,
+ 	[NFSD_Threads] = write_threads,
+ 	[NFSD_Pool_Threads] = write_pool_threads,
+ 	[NFSD_Versions] = write_versions,
+@@ -372,6 +376,28 @@ static ssize_t write_fo_unlock(struct fi
+ 	return strlen(buf);
+ }
+ 
++static ssize_t write_fo_grace(struct file *file, char *buf, size_t size)
++{
++	char *mesg = buf;
++	int fsid, rc;
++ 
++	if (size <= 0) return -EINVAL;
++ 
++	/* convert string into a valid fsid */
++	rc = get_int(&mesg, &fsid);
++	if (rc) 
++		return rc;
++ 
++	/* call nlm to set the grace period */
++	rc = nlmsvc_fo_setgrace(fsid);
++	if (rc) 
++		return rc;
++ 
++	/* done */
++	sprintf(buf, "nlm set per fsid=%d grace period\n", fsid);
++	return strlen(buf);
++}
++
+ extern int nfsd_nrthreads(void);
+ 
+ static ssize_t write_threads(struct file *file, char *buf, size_t size)
+@@ -676,6 +702,7 @@ static int nfsd_fill_super(struct super_
+ 		[NFSD_List] = {"exports", &exports_operations, S_IRUGO},
+ 		[NFSD_Fh] = {"filehandle", &transaction_ops, S_IWUSR|S_IRUSR},
+ 		[NFSD_NlmUnlock] = {"nlm_unlock", &transaction_ops, S_IWUSR|S_IRUSR},
++		[NFSD_NlmGrace] = {"nlm_set_grace_for_fsid", &transaction_ops, S_IWUSR|S_IRUSR},
+ 		[NFSD_Threads] = {"threads", &transaction_ops, S_IWUSR|S_IRUSR},
+ 		[NFSD_Pool_Threads] = {"pool_threads", &transaction_ops, S_IWUSR|S_IRUSR},
+ 		[NFSD_Versions] = {"versions", &transaction_ops, S_IWUSR|S_IRUSR},
+--- linux-nlm-1/fs/lockd/svcsubs.c	2007-03-26 10:23:22.000000000 -0400
++++ linux/fs/lockd/svcsubs.c	2007-03-26 16:01:54.000000000 -0400
+@@ -31,6 +31,13 @@
+ static struct hlist_head	nlm_files[FILE_NRHASH];
+ static DEFINE_MUTEX(nlm_file_mutex);
+ 
++/* 
++ * Global control structure for lock failover 
++ */
++static spinlock_t nlm_fo_lock=SPIN_LOCK_UNLOCKED;
++static int fo_fsid_cnt=0;
++LIST_HEAD(fo_fsid_list);
++
+ #ifdef NFSD_DEBUG
+ static inline void nlm_debug_print_fh(char *msg, struct nfs_fh *f)
+ {
+@@ -430,3 +437,165 @@ nlmsvc_fo_unlock(int *fsid)
+ }
+ 
+ 
++EXPORT_SYMBOL(nlmsvc_fo_setgrace);
++
++/*
++ * Add fsid into global fo_fsid_list.
++ *
++ * If this routine is repeatedly called with the same fsid, instead 
++ * of searching thru the list to purge old entries (to make the code 
++ * un-necessarily complicated), we will keep the old entries. Since
++ * the list is later searched in top-down order (newer entry first), 
++ * as soon as one is found, the search stops. This implies the older 
++ * entries will not be used and always expire before new entry.    
++ *
++ * As an admin interface, the list is expected to be short and 
++ * entries are purged (expired) quickly.
++ */
++int
++nlmsvc_fo_setgrace(int fsid)
++{
++	struct list_head *p, *tlist;
++	struct fo_fsid *per_fsid, *entry;
++	int done=0;
++
++	/* allocate the entry */
++	per_fsid = kmalloc(sizeof(struct fo_fsid), GFP_KERNEL);
++	if (per_fsid == NULL) {
++		printk("lockd: nlmsvc_fo_setgrace kmalloc fails\n");
++		return(-ENOMEM);
++	}
++
++	/* debug printk */
++	dprintk("lockd: nlmsvc_fo_setgrace fsid=%d jiffies=%lu\n", 
++		fsid, jiffies);
++
++	/* fill in info */
++	per_fsid->g_expire = set_grace_period();
++	per_fsid->g_fsid   = fsid;
++
++	spin_lock(&nlm_fo_lock);
++
++	if (list_empty(&fo_fsid_list)) {
++		list_add(&per_fsid->g_list, &fo_fsid_list);
++		fo_fsid_cnt = 1;
++		done = 1;
++		goto nlmsvc_fo_setgrace_out;
++	} else if (fo_fsid_cnt > NLM_FO_MAX_FSID_GP) {
++                kfree(per_fsid);
++                printk("lockd: fo_setgrace max cnt reached fsid=%d not added\n",                        fsid);
++                goto nlmsvc_fo_setgrace_out;
++        }
++
++	list_for_each_safe(p, tlist, &fo_fsid_list) {
++		entry = list_entry(p, struct fo_fsid, g_list);
++		if (!done) {
++			/* add the new fsid into the list */
++			if (entry->g_expire <= per_fsid->g_expire) {
++				list_add(&per_fsid->g_list, &entry->g_list);
++				fo_fsid_cnt++;
++				done = 1;
++			}
++		}
++		if (done && (entry->g_fsid == fsid)) {
++			/* multiple fsid(s) */
++			BUG_ON(entry->g_expire > per_fsid->g_expire); 
++			list_del(p); 
++			fo_fsid_cnt--;
++			kfree(entry);
++		} else if (time_before(entry->g_expire, jiffies)) {
++			/* garbage collection */
++			dprintk("nlmsvc fo_fsid = %d expires\n", entry->g_fsid);
++			list_del(p);
++			fo_fsid_cnt--;
++			kfree(entry);
++		} 
++	}
++	
++nlmsvc_fo_setgrace_out:
++
++	spin_unlock(&nlm_fo_lock);
++
++	/* debug */
++	if (done)
++		dprintk("nlmsvc fo setgrace: fsid=%d, jiffies=%lu, expire=%lu\n",
++			per_fsid->g_fsid, jiffies, per_fsid->g_expire);
++	else
++		dprintk("nlmsvc_fo_setgrace: adding fsid=%d fails\n", fsid);
++
++	return 0;
++}
++
++/* 
++ * Reset global fo_fsid_list list 
++ */
++void 
++nlmsvc_fo_reset_servs()
++{
++	struct fo_fsid *e_purge;
++	struct list_head *p, *tlist;
++
++	spin_lock(&nlm_fo_lock);
++
++	/* nothing to do */
++	if (list_empty(&fo_fsid_list)) {
++		spin_unlock(&nlm_fo_lock);
++		return;
++	}
++
++	dprintk("lockd: nlmsvc_fo_reset fo_fsid_list\n");
++
++	/* purge the entries */
++	list_for_each_safe(p, tlist, &fo_fsid_list) {
++		e_purge = list_entry(p, struct fo_fsid, g_list);
++		list_del(p);
++		kfree(e_purge);
++	}
++	fo_fsid_cnt = 0;
++
++	spin_unlock(&nlm_fo_lock);
++}
++
++/*
++ * Check whether the fsid is in the failover list: fo_fsid_list.
++ *	return TRUE (1) if fsid in nlm_serv.
++ */
++int
++nlmsvc_fo_check(struct nfs_fh *fh)
++{
++	struct fo_fsid *e_this;
++	struct list_head *p, *tlist;
++	int rc=0, this_fsid;
++
++	/* see if this fh has fsid */
++	if (!get_fsid(fh, &this_fsid)) {
++		return 0;
++	}
++
++	spin_lock(&nlm_fo_lock);
++
++	/* no failover entry */
++	if (list_empty(&fo_fsid_list))  
++		goto nlmsvc_fo_check_out;
++
++	/* check to see whether this_fsid is in fo_fsid_list list */
++	list_for_each_safe(p, tlist, &fo_fsid_list) {
++		e_this = list_entry(p, struct fo_fsid, g_list);
++		if (time_before(e_this->g_expire, jiffies)) {
++			printk("lockd: fsid=%d grace period expires\n",
++				e_this->g_fsid);
++			list_del(p);
++			fo_fsid_cnt--;
++			kfree(e_this);
++		} else if (e_this->g_fsid == this_fsid) {
++			printk("lockd: fsid=%d in grace period\n",
++				e_this->g_fsid);
++			rc = 1;
++		}
++	}
++
++nlmsvc_fo_check_out:
++	spin_unlock(&nlm_fo_lock);
++	return rc;
++}
++
+--- linux-nlm-1/fs/lockd/svc4proc.c	2007-03-26 10:23:22.000000000 -0400
++++ linux/fs/lockd/svc4proc.c	2007-03-26 17:34:27.000000000 -0400
+@@ -18,9 +18,10 @@
+ #include <linux/lockd/share.h>
+ #include <linux/lockd/sm_inter.h>
+ 
+-
+ #define NLMDBG_FACILITY		NLMDBG_CLIENT
+ 
++extern struct list_head fo_fsid_list;
++
+ /*
+  * Obtain client and file from arguments
+  */
+@@ -89,7 +90,7 @@ nlm4svc_proc_test(struct svc_rqst *rqstp
+ 	resp->cookie = argp->cookie;
+ 
+ 	/* Don't accept test requests during grace period */
+-	if (nlmsvc_grace_period) {
++	if (nlmsvc_check_grace_period(argp)) {
+ 		resp->status = nlm_lck_denied_grace_period;
+ 		return rpc_success;
+ 	}
+@@ -119,7 +120,7 @@ nlm4svc_proc_lock(struct svc_rqst *rqstp
+ 	resp->cookie = argp->cookie;
+ 
+ 	/* Don't accept new lock requests during grace period */
+-	if (nlmsvc_grace_period && !argp->reclaim) {
++	if (nlmsvc_check_grace_period(argp) && !argp->reclaim) {
+ 		resp->status = nlm_lck_denied_grace_period;
+ 		return rpc_success;
+ 	}
+@@ -162,7 +163,7 @@ nlm4svc_proc_cancel(struct svc_rqst *rqs
+ 	resp->cookie = argp->cookie;
+ 
+ 	/* Don't accept requests during grace period */
+-	if (nlmsvc_grace_period) {
++	if (nlmsvc_check_grace_period(argp)) {
+ 		resp->status = nlm_lck_denied_grace_period;
+ 		return rpc_success;
+ 	}
+@@ -195,7 +196,7 @@ nlm4svc_proc_unlock(struct svc_rqst *rqs
+ 	resp->cookie = argp->cookie;
+ 
+ 	/* Don't accept new lock requests during grace period */
+-	if (nlmsvc_grace_period) {
++	if (nlmsvc_check_grace_period(argp)) {
+ 		resp->status = nlm_lck_denied_grace_period;
+ 		return rpc_success;
+ 	}
+@@ -332,7 +333,7 @@ nlm4svc_proc_share(struct svc_rqst *rqst
+ 	resp->cookie = argp->cookie;
+ 
+ 	/* Don't accept new lock requests during grace period */
+-	if (nlmsvc_grace_period && !argp->reclaim) {
++	if (nlmsvc_check_grace_period(argp) && !argp->reclaim) {
+ 		resp->status = nlm_lck_denied_grace_period;
+ 		return rpc_success;
+ 	}
+@@ -365,7 +366,7 @@ nlm4svc_proc_unshare(struct svc_rqst *rq
+ 	resp->cookie = argp->cookie;
+ 
+ 	/* Don't accept requests during grace period */
+-	if (nlmsvc_grace_period) {
++	if (nlmsvc_check_grace_period(argp)) {
+ 		resp->status = nlm_lck_denied_grace_period;
+ 		return rpc_success;
+ 	}
+--- linux-nlm-1/fs/lockd/svcproc.c	2007-03-26 10:23:23.000000000 -0400
++++ linux/fs/lockd/svcproc.c	2007-03-26 17:37:30.000000000 -0400
+@@ -117,7 +117,7 @@ nlmsvc_proc_test(struct svc_rqst *rqstp,
+ 	resp->cookie = argp->cookie;
+ 
+ 	/* Don't accept test requests during grace period */
+-	if (nlmsvc_grace_period) {
++	if (nlmsvc_check_grace_period(argp)) {
+ 		resp->status = nlm_lck_denied_grace_period;
+ 		return rpc_success;
+ 	}
+@@ -148,7 +148,7 @@ nlmsvc_proc_lock(struct svc_rqst *rqstp,
+ 	resp->cookie = argp->cookie;
+ 
+ 	/* Don't accept new lock requests during grace period */
+-	if (nlmsvc_grace_period && !argp->reclaim) {
++	if (nlmsvc_check_grace_period(argp) && !argp->reclaim) {
+ 		resp->status = nlm_lck_denied_grace_period;
+ 		return rpc_success;
+ 	}
+@@ -191,7 +191,7 @@ nlmsvc_proc_cancel(struct svc_rqst *rqst
+ 	resp->cookie = argp->cookie;
+ 
+ 	/* Don't accept requests during grace period */
+-	if (nlmsvc_grace_period) {
++	if (nlmsvc_check_grace_period(argp)) {
+ 		resp->status = nlm_lck_denied_grace_period;
+ 		return rpc_success;
+ 	}
+@@ -224,7 +224,7 @@ nlmsvc_proc_unlock(struct svc_rqst *rqst
+ 	resp->cookie = argp->cookie;
+ 
+ 	/* Don't accept new lock requests during grace period */
+-	if (nlmsvc_grace_period) {
++	if (nlmsvc_check_grace_period(argp)) {
+ 		resp->status = nlm_lck_denied_grace_period;
+ 		return rpc_success;
+ 	}
+@@ -363,7 +363,7 @@ nlmsvc_proc_share(struct svc_rqst *rqstp
+ 	resp->cookie = argp->cookie;
+ 
+ 	/* Don't accept new lock requests during grace period */
+-	if (nlmsvc_grace_period && !argp->reclaim) {
++	if (nlmsvc_check_grace_period(argp) && !argp->reclaim) {
+ 		resp->status = nlm_lck_denied_grace_period;
+ 		return rpc_success;
+ 	}
+@@ -396,7 +396,7 @@ nlmsvc_proc_unshare(struct svc_rqst *rqs
+ 	resp->cookie = argp->cookie;
+ 
+ 	/* Don't accept requests during grace period */
+-	if (nlmsvc_grace_period) {
++	if (nlmsvc_check_grace_period(argp)) {
+ 		resp->status = nlm_lck_denied_grace_period;
+ 		return rpc_success;
+ 	}
+--- linux-nlm-1/fs/lockd/svc.c	2007-03-26 10:23:22.000000000 -0400
++++ linux/fs/lockd/svc.c	2007-03-26 11:16:27.000000000 -0400
+@@ -75,7 +75,7 @@ static const int		nlm_port_min = 0, nlm_
+ 
+ static struct ctl_table_header * nlm_sysctl_table;
+ 
+-static unsigned long set_grace_period(void)
++unsigned long set_grace_period(void)
+ {
+ 	unsigned long grace_period;
+ 
+@@ -85,7 +85,6 @@ static unsigned long set_grace_period(vo
+ 				/ nlm_timeout) * nlm_timeout * HZ;
+ 	else
+ 		grace_period = nlm_timeout * 5 * HZ;
+-	nlmsvc_grace_period = 1;
+ 	return grace_period + jiffies;
+ }
+ 
+@@ -133,6 +132,8 @@ lockd(struct svc_rqst *rqstp)
+ 	nlmsvc_timeout = nlm_timeout * HZ;
+ 
+ 	grace_period_expire = set_grace_period();
++	nlmsvc_grace_period = 1;
++	(void) nlmsvc_fo_reset_servs();
+ 
+ 	/*
+ 	 * The main request loop. We don't terminate until the last
+@@ -148,6 +149,8 @@ lockd(struct svc_rqst *rqstp)
+ 			if (nlmsvc_ops) {
+ 				nlmsvc_invalidate_all();
+ 				grace_period_expire = set_grace_period();
++				nlmsvc_grace_period = 1;
++				(void) nlmsvc_fo_reset_servs();
+ 			}
+ 		}
+ 
+@@ -194,6 +197,7 @@ lockd(struct svc_rqst *rqstp)
+ 		nlm_shutdown_hosts();
+ 		nlmsvc_pid = 0;
+ 		nlmsvc_serv = NULL;
++		(void) nlmsvc_fo_reset_servs();
+ 	} else
+ 		printk(KERN_DEBUG
+ 			"lockd: new process, skipping host shutdown\n");
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 79ab900..d711106 100644
--- a/a/content_digest
+++ b/N1/content_digest
@@ -1,10 +1,13 @@
  "ref\04508DF1A.4090907@redhat.com\0"
  "ref\017688.30806.252332.646157@cse.unsw.edu.au\0"
  "From\0Wendy Cheng <wcheng@redhat.com>\0"
- "Subject\0[Cluster-devel] Re: [NFS] [PATCH 2/4 Revised] NLM failover - nlm_set_igrace\0"
+ "Subject\0Re: [PATCH 2/4 Revised] NLM failover - nlm_set_igrace\0"
  "Date\0Mon, 26 Mar 2007 18:21:01 -0400\0"
- "To\0cluster-devel.redhat.com\0"
- "\00:1\0"
+ "To\0Neil Brown <neilb@suse.de>\0"
+ "Cc\0cluster-devel@redhat.com"
+  lhh@redhat.com
+ " nfs@lists.sourceforge.net\0"
+ "\01:1\0"
  "b\0"
  "Revised patch based on 2.6.21-rc4.\n"
  "\n"
@@ -16,14 +19,518 @@
  "\n"
  "shell> echo 1234 > /proc/fs/nfsd/nlm_set_grace_for_fsid\n"
  "\n"
- "-- Wendy\n"
+ -- Wendy
+ "\01:2\0"
+ "fn\0nlm_grace.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/svc.c              |    8 +-\n"
+ " fs/lockd/svc4proc.c         |   15 ++-\n"
+ " fs/lockd/svcproc.c          |   12 +--\n"
+ " fs/lockd/svcsubs.c          |  169 ++++++++++++++++++++++++++++++++++++++++++++\n"
+ " fs/nfsd/nfsctl.c            |   27 +++++++\n"
+ " include/linux/lockd/bind.h  |    2\n"
+ " include/linux/lockd/lockd.h |   30 +++++++\n"
+ " 7 files changed, 248 insertions(+), 15 deletions(-)\n"
  "\n"
- "-------------- next part --------------\n"
- "A non-text attachment was scrubbed...\n"
- "Name: nlm_grace.patch\n"
- "Type: text/x-patch\n"
- "Size: 15229 bytes\n"
- "Desc: not available\n"
- URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20070326/8b4c1701/attachment.bin>
+ "--- linux-nlm-1/include/linux/lockd/lockd.h\t2007-03-26 10:29:44.000000000 -0400\n"
+ "+++ linux/include/linux/lockd/lockd.h\t2007-03-26 17:37:39.000000000 -0400\n"
+ "@@ -114,6 +114,16 @@ struct nlm_file {\n"
+ " \tstruct mutex\t\tf_mutex;\t/* avoid concurrent access */\n"
+ " };\n"
+ " \n"
+ "+#define NLM_FO_MAX_FSID_GP\t127\n"
+ "+\n"
+ "+/* Server fsid linked list for NLM lock failover */\n"
+ "+struct fo_fsid {\n"
+ "+\tstruct list_head\tg_list;\t\t/* linked list */\n"
+ "+\tunsigned long\t\tg_expire;\t/* when this grace period\n"
+ "+\t\t\t\t\t\t * will expire */\n"
+ "+\tint\t\t\tg_fsid;\t\t/* exported fsid */\n"
+ "+};\n"
+ "+\n"
+ " /*\n"
+ "  * This is a server block (i.e. a lock requested by some client which\n"
+ "  * couldn't be granted because of a conflicting lock).\n"
+ "@@ -193,6 +203,8 @@ void\t\t  nlmsvc_traverse_blocks(struct nl\n"
+ " \t\t\t\t\tnlm_host_match_fn_t match);\n"
+ " void\t\t  nlmsvc_grant_reply(struct nlm_cookie *, __be32);\n"
+ " \n"
+ "+unsigned long set_grace_period(void); /*required by svcsubs.c and svc.c \n"
+ "+\t\t\t\t\tto support nlm failover */\n"
+ " /*\n"
+ "  * File handling for the server personality\n"
+ "  */\n"
+ "@@ -204,6 +216,7 @@ void\t\t  nlmsvc_free_host_resources(struc\n"
+ " void\t\t  nlmsvc_invalidate_all(void);\n"
+ " int\t\t  nlmsvc_same_fsid(struct nlm_host *, struct nlm_host *);\n"
+ " int\t\t  nlmsvc_fo_unlock(int *fsid);\n"
+ "+int\t\t  nlmsvc_fo_check(struct nfs_fh *fh);\n"
+ " \n"
+ " static __inline__ struct inode *\n"
+ " nlmsvc_file_inode(struct nlm_file *file)\n"
+ "@@ -234,6 +247,23 @@ nlm_compare_locks(const struct file_lock\n"
+ " \t     &&(fl1->fl_type  == fl2->fl_type || fl2->fl_type == F_UNLCK);\n"
+ " }\n"
+ " \n"
+ "+extern struct list_head fo_fsid_list;\n"
+ "+\n"
+ "+/*Check for grace period: return TRUE or FALSE */\n"
+ "+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"
+ "+\t\treturn 1;\n"
+ "+\n"
+ "+\t/* check for per exported fsid grace period */\n"
+ "+        if (unlikely(!list_empty(&fo_fsid_list)))\n"
+ "+                return(nlmsvc_fo_check(&argp->lock.fh));\n"
+ "+\n"
+ "+        return 0;\n"
+ "+}\n"
+ "+\n"
+ " extern struct lock_manager_operations nlmsvc_lock_operations;\n"
+ " \n"
+ " #endif /* __KERNEL__ */\n"
+ "--- linux-nlm-1/include/linux/lockd/bind.h\t2007-03-26 10:29:44.000000000 -0400\n"
+ "+++ linux/include/linux/lockd/bind.h\t2007-03-26 11:11:14.000000000 -0400\n"
+ "@@ -38,5 +38,7 @@ extern int\tnlmclnt_proc(struct inode *, \n"
+ " extern int\tlockd_up(int proto);\n"
+ " extern void\tlockd_down(void);\n"
+ " extern int\tnlmsvc_fo_unlock(int *fsid);\n"
+ "+extern int\tnlmsvc_fo_setgrace(int fsid);\n"
+ "+extern void\tnlmsvc_fo_reset_servs(void);\n"
+ " \n"
+ " #endif /* LINUX_LOCKD_BIND_H */\n"
+ "--- linux-nlm-1/fs/nfsd/nfsctl.c\t2007-03-26 10:23:36.000000000 -0400\n"
+ "+++ linux/fs/nfsd/nfsctl.c\t2007-03-26 15:40:12.000000000 -0400\n"
+ "@@ -55,6 +55,7 @@ enum {\n"
+ " \tNFSD_List,\n"
+ " \tNFSD_Fh,\n"
+ " \tNFSD_NlmUnlock,\n"
+ "+\tNFSD_NlmGrace,\n"
+ " \tNFSD_Threads,\n"
+ " \tNFSD_Pool_Threads,\n"
+ " \tNFSD_Versions,\n"
+ "@@ -91,6 +92,8 @@ static ssize_t write_maxblksize(struct f\n"
+ " static ssize_t write_leasetime(struct file *file, char *buf, size_t size);\n"
+ " static ssize_t write_recoverydir(struct file *file, char *buf, size_t size);\n"
+ " #endif\n"
+ "+static ssize_t write_fo_unlock(struct file *file, char *buf, size_t size);\n"
+ "+static ssize_t write_fo_grace(struct file *file, char *buf, size_t size);\n"
+ " \n"
+ " static ssize_t (*write_op[])(struct file *, char *, size_t) = {\n"
+ " \t[NFSD_Svc] = write_svc,\n"
+ "@@ -102,6 +105,7 @@ static ssize_t (*write_op[])(struct file\n"
+ " \t[NFSD_Getfs] = write_getfs,\n"
+ " \t[NFSD_Fh] = write_filehandle,\n"
+ " \t[NFSD_NlmUnlock] = write_fo_unlock,\n"
+ "+\t[NFSD_NlmGrace] = write_fo_grace,\n"
+ " \t[NFSD_Threads] = write_threads,\n"
+ " \t[NFSD_Pool_Threads] = write_pool_threads,\n"
+ " \t[NFSD_Versions] = write_versions,\n"
+ "@@ -372,6 +376,28 @@ static ssize_t write_fo_unlock(struct fi\n"
+ " \treturn strlen(buf);\n"
+ " }\n"
+ " \n"
+ "+static ssize_t write_fo_grace(struct file *file, char *buf, size_t size)\n"
+ "+{\n"
+ "+\tchar *mesg = buf;\n"
+ "+\tint fsid, rc;\n"
+ "+ \n"
+ "+\tif (size <= 0) return -EINVAL;\n"
+ "+ \n"
+ "+\t/* convert string into a valid fsid */\n"
+ "+\trc = get_int(&mesg, &fsid);\n"
+ "+\tif (rc) \n"
+ "+\t\treturn rc;\n"
+ "+ \n"
+ "+\t/* call nlm to set the grace period */\n"
+ "+\trc = nlmsvc_fo_setgrace(fsid);\n"
+ "+\tif (rc) \n"
+ "+\t\treturn rc;\n"
+ "+ \n"
+ "+\t/* done */\n"
+ "+\tsprintf(buf, \"nlm set per fsid=%d grace period\\n\", fsid);\n"
+ "+\treturn strlen(buf);\n"
+ "+}\n"
+ "+\n"
+ " extern int nfsd_nrthreads(void);\n"
+ " \n"
+ " static ssize_t write_threads(struct file *file, char *buf, size_t size)\n"
+ "@@ -676,6 +702,7 @@ static int nfsd_fill_super(struct super_\n"
+ " \t\t[NFSD_List] = {\"exports\", &exports_operations, S_IRUGO},\n"
+ " \t\t[NFSD_Fh] = {\"filehandle\", &transaction_ops, S_IWUSR|S_IRUSR},\n"
+ " \t\t[NFSD_NlmUnlock] = {\"nlm_unlock\", &transaction_ops, S_IWUSR|S_IRUSR},\n"
+ "+\t\t[NFSD_NlmGrace] = {\"nlm_set_grace_for_fsid\", &transaction_ops, S_IWUSR|S_IRUSR},\n"
+ " \t\t[NFSD_Threads] = {\"threads\", &transaction_ops, S_IWUSR|S_IRUSR},\n"
+ " \t\t[NFSD_Pool_Threads] = {\"pool_threads\", &transaction_ops, S_IWUSR|S_IRUSR},\n"
+ " \t\t[NFSD_Versions] = {\"versions\", &transaction_ops, S_IWUSR|S_IRUSR},\n"
+ "--- linux-nlm-1/fs/lockd/svcsubs.c\t2007-03-26 10:23:22.000000000 -0400\n"
+ "+++ linux/fs/lockd/svcsubs.c\t2007-03-26 16:01:54.000000000 -0400\n"
+ "@@ -31,6 +31,13 @@\n"
+ " static struct hlist_head\tnlm_files[FILE_NRHASH];\n"
+ " static DEFINE_MUTEX(nlm_file_mutex);\n"
+ " \n"
+ "+/* \n"
+ "+ * Global control structure for lock failover \n"
+ "+ */\n"
+ "+static spinlock_t nlm_fo_lock=SPIN_LOCK_UNLOCKED;\n"
+ "+static int fo_fsid_cnt=0;\n"
+ "+LIST_HEAD(fo_fsid_list);\n"
+ "+\n"
+ " #ifdef NFSD_DEBUG\n"
+ " static inline void nlm_debug_print_fh(char *msg, struct nfs_fh *f)\n"
+ " {\n"
+ "@@ -430,3 +437,165 @@ nlmsvc_fo_unlock(int *fsid)\n"
+ " }\n"
+ " \n"
+ " \n"
+ "+EXPORT_SYMBOL(nlmsvc_fo_setgrace);\n"
+ "+\n"
+ "+/*\n"
+ "+ * Add fsid into global fo_fsid_list.\n"
+ "+ *\n"
+ "+ * If this routine is repeatedly called with the same fsid, instead \n"
+ "+ * of searching thru the list to purge old entries (to make the code \n"
+ "+ * un-necessarily complicated), we will keep the old entries. Since\n"
+ "+ * the list is later searched in top-down order (newer entry first), \n"
+ "+ * as soon as one is found, the search stops. This implies the older \n"
+ "+ * entries will not be used and always expire before new entry.    \n"
+ "+ *\n"
+ "+ * As an admin interface, the list is expected to be short and \n"
+ "+ * entries are purged (expired) quickly.\n"
+ "+ */\n"
+ "+int\n"
+ "+nlmsvc_fo_setgrace(int fsid)\n"
+ "+{\n"
+ "+\tstruct list_head *p, *tlist;\n"
+ "+\tstruct fo_fsid *per_fsid, *entry;\n"
+ "+\tint done=0;\n"
+ "+\n"
+ "+\t/* allocate the entry */\n"
+ "+\tper_fsid = kmalloc(sizeof(struct fo_fsid), GFP_KERNEL);\n"
+ "+\tif (per_fsid == NULL) {\n"
+ "+\t\tprintk(\"lockd: nlmsvc_fo_setgrace kmalloc fails\\n\");\n"
+ "+\t\treturn(-ENOMEM);\n"
+ "+\t}\n"
+ "+\n"
+ "+\t/* debug printk */\n"
+ "+\tdprintk(\"lockd: nlmsvc_fo_setgrace fsid=%d jiffies=%lu\\n\", \n"
+ "+\t\tfsid, jiffies);\n"
+ "+\n"
+ "+\t/* fill in info */\n"
+ "+\tper_fsid->g_expire = set_grace_period();\n"
+ "+\tper_fsid->g_fsid   = fsid;\n"
+ "+\n"
+ "+\tspin_lock(&nlm_fo_lock);\n"
+ "+\n"
+ "+\tif (list_empty(&fo_fsid_list)) {\n"
+ "+\t\tlist_add(&per_fsid->g_list, &fo_fsid_list);\n"
+ "+\t\tfo_fsid_cnt = 1;\n"
+ "+\t\tdone = 1;\n"
+ "+\t\tgoto nlmsvc_fo_setgrace_out;\n"
+ "+\t} else if (fo_fsid_cnt > NLM_FO_MAX_FSID_GP) {\n"
+ "+                kfree(per_fsid);\n"
+ "+                printk(\"lockd: fo_setgrace max cnt reached fsid=%d not added\\n\",                        fsid);\n"
+ "+                goto nlmsvc_fo_setgrace_out;\n"
+ "+        }\n"
+ "+\n"
+ "+\tlist_for_each_safe(p, tlist, &fo_fsid_list) {\n"
+ "+\t\tentry = list_entry(p, struct fo_fsid, g_list);\n"
+ "+\t\tif (!done) {\n"
+ "+\t\t\t/* add the new fsid into the list */\n"
+ "+\t\t\tif (entry->g_expire <= per_fsid->g_expire) {\n"
+ "+\t\t\t\tlist_add(&per_fsid->g_list, &entry->g_list);\n"
+ "+\t\t\t\tfo_fsid_cnt++;\n"
+ "+\t\t\t\tdone = 1;\n"
+ "+\t\t\t}\n"
+ "+\t\t}\n"
+ "+\t\tif (done && (entry->g_fsid == fsid)) {\n"
+ "+\t\t\t/* multiple fsid(s) */\n"
+ "+\t\t\tBUG_ON(entry->g_expire > per_fsid->g_expire); \n"
+ "+\t\t\tlist_del(p); \n"
+ "+\t\t\tfo_fsid_cnt--;\n"
+ "+\t\t\tkfree(entry);\n"
+ "+\t\t} else if (time_before(entry->g_expire, jiffies)) {\n"
+ "+\t\t\t/* garbage collection */\n"
+ "+\t\t\tdprintk(\"nlmsvc fo_fsid = %d expires\\n\", entry->g_fsid);\n"
+ "+\t\t\tlist_del(p);\n"
+ "+\t\t\tfo_fsid_cnt--;\n"
+ "+\t\t\tkfree(entry);\n"
+ "+\t\t} \n"
+ "+\t}\n"
+ "+\t\n"
+ "+nlmsvc_fo_setgrace_out:\n"
+ "+\n"
+ "+\tspin_unlock(&nlm_fo_lock);\n"
+ "+\n"
+ "+\t/* debug */\n"
+ "+\tif (done)\n"
+ "+\t\tdprintk(\"nlmsvc fo setgrace: fsid=%d, jiffies=%lu, expire=%lu\\n\",\n"
+ "+\t\t\tper_fsid->g_fsid, jiffies, per_fsid->g_expire);\n"
+ "+\telse\n"
+ "+\t\tdprintk(\"nlmsvc_fo_setgrace: adding fsid=%d fails\\n\", fsid);\n"
+ "+\n"
+ "+\treturn 0;\n"
+ "+}\n"
+ "+\n"
+ "+/* \n"
+ "+ * Reset global fo_fsid_list list \n"
+ "+ */\n"
+ "+void \n"
+ "+nlmsvc_fo_reset_servs()\n"
+ "+{\n"
+ "+\tstruct fo_fsid *e_purge;\n"
+ "+\tstruct list_head *p, *tlist;\n"
+ "+\n"
+ "+\tspin_lock(&nlm_fo_lock);\n"
+ "+\n"
+ "+\t/* nothing to do */\n"
+ "+\tif (list_empty(&fo_fsid_list)) {\n"
+ "+\t\tspin_unlock(&nlm_fo_lock);\n"
+ "+\t\treturn;\n"
+ "+\t}\n"
+ "+\n"
+ "+\tdprintk(\"lockd: nlmsvc_fo_reset fo_fsid_list\\n\");\n"
+ "+\n"
+ "+\t/* purge the entries */\n"
+ "+\tlist_for_each_safe(p, tlist, &fo_fsid_list) {\n"
+ "+\t\te_purge = list_entry(p, struct fo_fsid, g_list);\n"
+ "+\t\tlist_del(p);\n"
+ "+\t\tkfree(e_purge);\n"
+ "+\t}\n"
+ "+\tfo_fsid_cnt = 0;\n"
+ "+\n"
+ "+\tspin_unlock(&nlm_fo_lock);\n"
+ "+}\n"
+ "+\n"
+ "+/*\n"
+ "+ * Check whether the fsid is in the failover list: fo_fsid_list.\n"
+ "+ *\treturn TRUE (1) if fsid in nlm_serv.\n"
+ "+ */\n"
+ "+int\n"
+ "+nlmsvc_fo_check(struct nfs_fh *fh)\n"
+ "+{\n"
+ "+\tstruct fo_fsid *e_this;\n"
+ "+\tstruct list_head *p, *tlist;\n"
+ "+\tint rc=0, this_fsid;\n"
+ "+\n"
+ "+\t/* see if this fh has fsid */\n"
+ "+\tif (!get_fsid(fh, &this_fsid)) {\n"
+ "+\t\treturn 0;\n"
+ "+\t}\n"
+ "+\n"
+ "+\tspin_lock(&nlm_fo_lock);\n"
+ "+\n"
+ "+\t/* no failover entry */\n"
+ "+\tif (list_empty(&fo_fsid_list))  \n"
+ "+\t\tgoto nlmsvc_fo_check_out;\n"
+ "+\n"
+ "+\t/* check to see whether this_fsid is in fo_fsid_list list */\n"
+ "+\tlist_for_each_safe(p, tlist, &fo_fsid_list) {\n"
+ "+\t\te_this = list_entry(p, struct fo_fsid, g_list);\n"
+ "+\t\tif (time_before(e_this->g_expire, jiffies)) {\n"
+ "+\t\t\tprintk(\"lockd: fsid=%d grace period expires\\n\",\n"
+ "+\t\t\t\te_this->g_fsid);\n"
+ "+\t\t\tlist_del(p);\n"
+ "+\t\t\tfo_fsid_cnt--;\n"
+ "+\t\t\tkfree(e_this);\n"
+ "+\t\t} else if (e_this->g_fsid == this_fsid) {\n"
+ "+\t\t\tprintk(\"lockd: fsid=%d in grace period\\n\",\n"
+ "+\t\t\t\te_this->g_fsid);\n"
+ "+\t\t\trc = 1;\n"
+ "+\t\t}\n"
+ "+\t}\n"
+ "+\n"
+ "+nlmsvc_fo_check_out:\n"
+ "+\tspin_unlock(&nlm_fo_lock);\n"
+ "+\treturn rc;\n"
+ "+}\n"
+ "+\n"
+ "--- linux-nlm-1/fs/lockd/svc4proc.c\t2007-03-26 10:23:22.000000000 -0400\n"
+ "+++ linux/fs/lockd/svc4proc.c\t2007-03-26 17:34:27.000000000 -0400\n"
+ "@@ -18,9 +18,10 @@\n"
+ " #include <linux/lockd/share.h>\n"
+ " #include <linux/lockd/sm_inter.h>\n"
+ " \n"
+ "-\n"
+ " #define NLMDBG_FACILITY\t\tNLMDBG_CLIENT\n"
+ " \n"
+ "+extern struct list_head fo_fsid_list;\n"
+ "+\n"
+ " /*\n"
+ "  * Obtain client and file from arguments\n"
+ "  */\n"
+ "@@ -89,7 +90,7 @@ nlm4svc_proc_test(struct svc_rqst *rqstp\n"
+ " \tresp->cookie = argp->cookie;\n"
+ " \n"
+ " \t/* Don't accept test requests during grace period */\n"
+ "-\tif (nlmsvc_grace_period) {\n"
+ "+\tif (nlmsvc_check_grace_period(argp)) {\n"
+ " \t\tresp->status = nlm_lck_denied_grace_period;\n"
+ " \t\treturn rpc_success;\n"
+ " \t}\n"
+ "@@ -119,7 +120,7 @@ nlm4svc_proc_lock(struct svc_rqst *rqstp\n"
+ " \tresp->cookie = argp->cookie;\n"
+ " \n"
+ " \t/* Don't accept new lock requests during grace period */\n"
+ "-\tif (nlmsvc_grace_period && !argp->reclaim) {\n"
+ "+\tif (nlmsvc_check_grace_period(argp) && !argp->reclaim) {\n"
+ " \t\tresp->status = nlm_lck_denied_grace_period;\n"
+ " \t\treturn rpc_success;\n"
+ " \t}\n"
+ "@@ -162,7 +163,7 @@ nlm4svc_proc_cancel(struct svc_rqst *rqs\n"
+ " \tresp->cookie = argp->cookie;\n"
+ " \n"
+ " \t/* Don't accept requests during grace period */\n"
+ "-\tif (nlmsvc_grace_period) {\n"
+ "+\tif (nlmsvc_check_grace_period(argp)) {\n"
+ " \t\tresp->status = nlm_lck_denied_grace_period;\n"
+ " \t\treturn rpc_success;\n"
+ " \t}\n"
+ "@@ -195,7 +196,7 @@ nlm4svc_proc_unlock(struct svc_rqst *rqs\n"
+ " \tresp->cookie = argp->cookie;\n"
+ " \n"
+ " \t/* Don't accept new lock requests during grace period */\n"
+ "-\tif (nlmsvc_grace_period) {\n"
+ "+\tif (nlmsvc_check_grace_period(argp)) {\n"
+ " \t\tresp->status = nlm_lck_denied_grace_period;\n"
+ " \t\treturn rpc_success;\n"
+ " \t}\n"
+ "@@ -332,7 +333,7 @@ nlm4svc_proc_share(struct svc_rqst *rqst\n"
+ " \tresp->cookie = argp->cookie;\n"
+ " \n"
+ " \t/* Don't accept new lock requests during grace period */\n"
+ "-\tif (nlmsvc_grace_period && !argp->reclaim) {\n"
+ "+\tif (nlmsvc_check_grace_period(argp) && !argp->reclaim) {\n"
+ " \t\tresp->status = nlm_lck_denied_grace_period;\n"
+ " \t\treturn rpc_success;\n"
+ " \t}\n"
+ "@@ -365,7 +366,7 @@ nlm4svc_proc_unshare(struct svc_rqst *rq\n"
+ " \tresp->cookie = argp->cookie;\n"
+ " \n"
+ " \t/* Don't accept requests during grace period */\n"
+ "-\tif (nlmsvc_grace_period) {\n"
+ "+\tif (nlmsvc_check_grace_period(argp)) {\n"
+ " \t\tresp->status = nlm_lck_denied_grace_period;\n"
+ " \t\treturn rpc_success;\n"
+ " \t}\n"
+ "--- linux-nlm-1/fs/lockd/svcproc.c\t2007-03-26 10:23:23.000000000 -0400\n"
+ "+++ linux/fs/lockd/svcproc.c\t2007-03-26 17:37:30.000000000 -0400\n"
+ "@@ -117,7 +117,7 @@ nlmsvc_proc_test(struct svc_rqst *rqstp,\n"
+ " \tresp->cookie = argp->cookie;\n"
+ " \n"
+ " \t/* Don't accept test requests during grace period */\n"
+ "-\tif (nlmsvc_grace_period) {\n"
+ "+\tif (nlmsvc_check_grace_period(argp)) {\n"
+ " \t\tresp->status = nlm_lck_denied_grace_period;\n"
+ " \t\treturn rpc_success;\n"
+ " \t}\n"
+ "@@ -148,7 +148,7 @@ nlmsvc_proc_lock(struct svc_rqst *rqstp,\n"
+ " \tresp->cookie = argp->cookie;\n"
+ " \n"
+ " \t/* Don't accept new lock requests during grace period */\n"
+ "-\tif (nlmsvc_grace_period && !argp->reclaim) {\n"
+ "+\tif (nlmsvc_check_grace_period(argp) && !argp->reclaim) {\n"
+ " \t\tresp->status = nlm_lck_denied_grace_period;\n"
+ " \t\treturn rpc_success;\n"
+ " \t}\n"
+ "@@ -191,7 +191,7 @@ nlmsvc_proc_cancel(struct svc_rqst *rqst\n"
+ " \tresp->cookie = argp->cookie;\n"
+ " \n"
+ " \t/* Don't accept requests during grace period */\n"
+ "-\tif (nlmsvc_grace_period) {\n"
+ "+\tif (nlmsvc_check_grace_period(argp)) {\n"
+ " \t\tresp->status = nlm_lck_denied_grace_period;\n"
+ " \t\treturn rpc_success;\n"
+ " \t}\n"
+ "@@ -224,7 +224,7 @@ nlmsvc_proc_unlock(struct svc_rqst *rqst\n"
+ " \tresp->cookie = argp->cookie;\n"
+ " \n"
+ " \t/* Don't accept new lock requests during grace period */\n"
+ "-\tif (nlmsvc_grace_period) {\n"
+ "+\tif (nlmsvc_check_grace_period(argp)) {\n"
+ " \t\tresp->status = nlm_lck_denied_grace_period;\n"
+ " \t\treturn rpc_success;\n"
+ " \t}\n"
+ "@@ -363,7 +363,7 @@ nlmsvc_proc_share(struct svc_rqst *rqstp\n"
+ " \tresp->cookie = argp->cookie;\n"
+ " \n"
+ " \t/* Don't accept new lock requests during grace period */\n"
+ "-\tif (nlmsvc_grace_period && !argp->reclaim) {\n"
+ "+\tif (nlmsvc_check_grace_period(argp) && !argp->reclaim) {\n"
+ " \t\tresp->status = nlm_lck_denied_grace_period;\n"
+ " \t\treturn rpc_success;\n"
+ " \t}\n"
+ "@@ -396,7 +396,7 @@ nlmsvc_proc_unshare(struct svc_rqst *rqs\n"
+ " \tresp->cookie = argp->cookie;\n"
+ " \n"
+ " \t/* Don't accept requests during grace period */\n"
+ "-\tif (nlmsvc_grace_period) {\n"
+ "+\tif (nlmsvc_check_grace_period(argp)) {\n"
+ " \t\tresp->status = nlm_lck_denied_grace_period;\n"
+ " \t\treturn rpc_success;\n"
+ " \t}\n"
+ "--- linux-nlm-1/fs/lockd/svc.c\t2007-03-26 10:23:22.000000000 -0400\n"
+ "+++ linux/fs/lockd/svc.c\t2007-03-26 11:16:27.000000000 -0400\n"
+ "@@ -75,7 +75,7 @@ static const int\t\tnlm_port_min = 0, nlm_\n"
+ " \n"
+ " static struct ctl_table_header * nlm_sysctl_table;\n"
+ " \n"
+ "-static unsigned long set_grace_period(void)\n"
+ "+unsigned long set_grace_period(void)\n"
+ " {\n"
+ " \tunsigned long grace_period;\n"
+ " \n"
+ "@@ -85,7 +85,6 @@ static unsigned long set_grace_period(vo\n"
+ " \t\t\t\t/ nlm_timeout) * nlm_timeout * HZ;\n"
+ " \telse\n"
+ " \t\tgrace_period = nlm_timeout * 5 * HZ;\n"
+ "-\tnlmsvc_grace_period = 1;\n"
+ " \treturn grace_period + jiffies;\n"
+ " }\n"
+ " \n"
+ "@@ -133,6 +132,8 @@ lockd(struct svc_rqst *rqstp)\n"
+ " \tnlmsvc_timeout = nlm_timeout * HZ;\n"
+ " \n"
+ " \tgrace_period_expire = set_grace_period();\n"
+ "+\tnlmsvc_grace_period = 1;\n"
+ "+\t(void) nlmsvc_fo_reset_servs();\n"
+ " \n"
+ " \t/*\n"
+ " \t * The main request loop. We don't terminate until the last\n"
+ "@@ -148,6 +149,8 @@ lockd(struct svc_rqst *rqstp)\n"
+ " \t\t\tif (nlmsvc_ops) {\n"
+ " \t\t\t\tnlmsvc_invalidate_all();\n"
+ " \t\t\t\tgrace_period_expire = set_grace_period();\n"
+ "+\t\t\t\tnlmsvc_grace_period = 1;\n"
+ "+\t\t\t\t(void) nlmsvc_fo_reset_servs();\n"
+ " \t\t\t}\n"
+ " \t\t}\n"
+ " \n"
+ "@@ -194,6 +197,7 @@ lockd(struct svc_rqst *rqstp)\n"
+ " \t\tnlm_shutdown_hosts();\n"
+ " \t\tnlmsvc_pid = 0;\n"
+ " \t\tnlmsvc_serv = NULL;\n"
+ "+\t\t(void) nlmsvc_fo_reset_servs();\n"
+ " \t} else\n"
+ " \t\tprintk(KERN_DEBUG\n"
+ " \t\t\t\"lockd: new process, skipping host shutdown\\n\");"
+ "\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
 
-6222a4cc61f8de00d565679fd1b928ccdfe42a583be7df817b1ba6310141280a
+a643fcfaae2c6c7e5e90fbc3c73c6d4b7eb3d6d9b7fb49dd3a83a8e493b11836

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.