From: NeilBrown 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: J. Bruce Fields Signed-off-by: Neil Brown Signed-off-by: Andrew Morton --- fs/nfsd/nfs4state.c | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) diff -puN fs/nfsd/nfs4state.c~nfsd4-err_grace-should-bump-seqid-on-lock fs/nfsd/nfs4state.c --- 25/fs/nfsd/nfs4state.c~nfsd4-err_grace-should-bump-seqid-on-lock Wed Jul 6 13:08:34 2005 +++ 25-akpm/fs/nfsd/nfs4state.c Wed Jul 6 13:08:34 2005 @@ -2706,11 +2706,6 @@ nfsd4_lock(struct svc_rqst *rqstp, struc (long long) lock->lk_offset, (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)) return nfserr_inval; @@ -2785,6 +2780,13 @@ nfsd4_lock(struct svc_rqst *rqstp, struc 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); switch (lock->lk_type) { case NFS4_READ_LT: _