aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@citi.umich.edu>2008-02-06 15:05:12 -0500
committerJ. Bruce Fields <bfields@citi.umich.edu>2008-10-03 16:19:20 -0400
commitd22b1cff099737f74f3ac5950094508b4cddec1e (patch)
treed93e297275719fd4a1b7a7a6731bf3befd44a5a6 /fs
parentb2b5028905226f85075a408b1118857c9aa48bb3 (diff)
lockd: reject reclaims outside the grace period
The current lockd does not reject reclaims that arrive outside of the grace period. Accepting a reclaim means promising to the client that no conflicting locks were granted since last it held the lock. We can meet that promise if we assume the only lockers are nfs clients, and that they are sufficiently well-behaved to reclaim only locks that they held before, and that only reclaim locks have been permitted so far. Once we leave the grace period (and start permitting non-reclaims), we can no longer keep that promise. So we must start rejecting reclaims at that point. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs')
-rw-r--r--fs/lockd/svclock.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c
index 808d246ada4d..6063a8e4b9f3 100644
--- a/fs/lockd/svclock.c
+++ b/fs/lockd/svclock.c
@@ -410,6 +410,10 @@ nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file,
410 ret = nlm_lck_denied_grace_period; 410 ret = nlm_lck_denied_grace_period;
411 goto out; 411 goto out;
412 } 412 }
413 if (reclaim && !locks_in_grace()) {
414 ret = nlm_lck_denied_grace_period;
415 goto out;
416 }
413 417
414 if (!wait) 418 if (!wait)
415 lock->fl.fl_flags &= ~FL_SLEEP; 419 lock->fl.fl_flags &= ~FL_SLEEP;