summaryrefslogtreecommitdiffstats
path: root/fs/nfsd
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@citi.umich.edu>2010-03-02 11:18:40 -0500
committerJ. Bruce Fields <bfields@citi.umich.edu>2010-03-06 15:02:10 -0500
commite7b184f199fd3c80b618ec8244cbda70857d2779 (patch)
tree217afb84633da9f4e563450950439e763e773e05 /fs/nfsd
parentefc4bb4fdd09c11f5558446e584a494c6feb43c7 (diff)
downloadop-kernel-dev-e7b184f199fd3c80b618ec8244cbda70857d2779.zip
op-kernel-dev-e7b184f199fd3c80b618ec8244cbda70857d2779.tar.gz
nfsd4: document lease/grace-period limits
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>
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/nfsctl.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index 7ab70ff..413cb8e 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 __nfsd4_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 __nfsd4_write_time(struct file *file, char *buf, size_t size, tim
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;
OpenPOWER on IntegriCloud