mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-03 17:40:04 +00:00
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>
This commit is contained in:
parent
b2b5028905
commit
d22b1cff09
1 changed files with 4 additions and 0 deletions
|
@ -410,6 +410,10 @@ nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file,
|
||||||
ret = nlm_lck_denied_grace_period;
|
ret = nlm_lck_denied_grace_period;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
if (reclaim && !locks_in_grace()) {
|
||||||
|
ret = nlm_lck_denied_grace_period;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
if (!wait)
|
if (!wait)
|
||||||
lock->fl.fl_flags &= ~FL_SLEEP;
|
lock->fl.fl_flags &= ~FL_SLEEP;
|
||||||
|
|
Loading…
Reference in a new issue