Commit 0dd395dc authored by NeilBrown's avatar NeilBrown Committed by Linus Torvalds

[PATCH] nfsd4: ERR_GRACE should bump seqid on lock

A GRACE or NOGRACE response to a lock request should also bump the sequence
id.  So we delay the handling of grace period errors till after we've found
the relevant owner.
Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: default avatarNeil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent b648330a
...@@ -2706,11 +2706,6 @@ nfsd4_lock(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_lock ...@@ -2706,11 +2706,6 @@ nfsd4_lock(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_lock
(long long) lock->lk_offset, (long long) lock->lk_offset,
(long long) lock->lk_length); (long long) lock->lk_length);
if (nfs4_in_grace() && !lock->lk_reclaim)
return nfserr_grace;
if (!nfs4_in_grace() && lock->lk_reclaim)
return nfserr_no_grace;
if (check_lock_length(lock->lk_offset, lock->lk_length)) if (check_lock_length(lock->lk_offset, lock->lk_length))
return nfserr_inval; return nfserr_inval;
...@@ -2785,6 +2780,13 @@ nfsd4_lock(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_lock ...@@ -2785,6 +2780,13 @@ nfsd4_lock(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_lock
goto out; goto out;
} }
status = nfserr_grace;
if (nfs4_in_grace() && !lock->lk_reclaim)
goto out;
status = nfserr_no_grace;
if (!nfs4_in_grace() && lock->lk_reclaim)
goto out;
locks_init_lock(&file_lock); locks_init_lock(&file_lock);
switch (lock->lk_type) { switch (lock->lk_type) {
case NFS4_READ_LT: case NFS4_READ_LT:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment