public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@citi.umich.edu>
To: linux-nfs@vger.kernel.org
Cc: "J. Bruce Fields" <bfields@citi.umich.edu>
Subject: [PATCH 7/7] nfsd4: document lease/grace-period limits
Date: Tue,  2 Mar 2010 18:12:53 -0500	[thread overview]
Message-ID: <1267571573-11844-8-git-send-email-bfields@citi.umich.edu> (raw)
In-Reply-To: <1267571573-11844-7-git-send-email-bfields@citi.umich.edu>

The current documentation here is out of date, and not quite right.

(Future work: some user documentation would be useful.)

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
---
 fs/nfsd/nfsctl.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index 7bdaf31..8dd212a 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -1208,9 +1208,6 @@ static ssize_t write_maxblksize(struct file *file, char *buf, size_t size)
 #ifdef CONFIG_NFSD_V4
 static ssize_t __write_time(struct file *file, char *buf, size_t size, time_t *time)
 {
-	/* if size > 10 seconds, call
-	 * nfs4_reset_lease() then write out the new lease (seconds) as reply
-	 */
 	char *mesg = buf;
 	int rv, i;
 
@@ -1220,6 +1217,18 @@ static ssize_t __write_time(struct file *file, char *buf, size_t size, time_t *t
 		rv = get_int(&mesg, &i);
 		if (rv)
 			return rv;
+		/*
+		 * Some sanity checking.  We don't have a reason for
+		 * these particular numbers, but problems with the
+		 * extremes are:
+		 *	- Too short: the briefest network outage may
+		 *	  cause clients to lose all their locks.  Also,
+		 *	  the frequent polling may be wasteful.
+		 *	- Too long: do you really want reboot recovery
+		 *	  to take more than an hour?  Or to make other
+		 *	  clients wait an hour before being able to
+		 *	  revoke a dead client's locks?
+		 */
 		if (i < 10 || i > 3600)
 			return -EINVAL;
 		*time = i;
-- 
1.6.3.3


  reply	other threads:[~2010-03-02 23:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-02 23:12 grace period setting J. Bruce Fields
2010-03-02 23:12 ` [PATCH 1/7] nfsd4: simplify references to nfsd4 lease time J. Bruce Fields
2010-03-02 23:12   ` [PATCH 2/7] nfsd4: edit comment for concision J. Bruce Fields
2010-03-02 23:12     ` [PATCH 3/7] nfsd4: simplify lease/grace interaction J. Bruce Fields
2010-03-02 23:12       ` [PATCH 4/7] nfsd4: remove unnecessary lease-setting function J. Bruce Fields
2010-03-02 23:12         ` [PATCH 5/7] nfsd4: reshuffle lease-setting code to allow reuse J. Bruce Fields
2010-03-02 23:12           ` [PATCH 6/7] nfsd4: allow setting grace period time J. Bruce Fields
2010-03-02 23:12             ` J. Bruce Fields [this message]
2010-03-03 15:47           ` [PATCH 5/7] nfsd4: reshuffle lease-setting code to allow reuse Peter Staubach
2010-03-06 18:31             ` J. Bruce Fields
2010-03-03 18:06     ` [PATCH 2/7] nfsd4: edit comment for concision Chuck Lever
2010-03-06 18:50       ` J. Bruce Fields
2010-03-08 15:31         ` Chuck Lever
2010-03-08 18:10           ` J. Bruce Fields
2010-03-08 18:16             ` Chuck Lever

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=1267571573-11844-8-git-send-email-bfields@citi.umich.edu \
    --to=bfields@citi.umich.edu \
    --cc=linux-nfs@vger.kernel.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