aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2014-03-29 14:43:38 -0400
committerJ. Bruce Fields <bfields@redhat.com>2014-03-30 10:47:33 -0400
commita8a7c6776f8d74780348bef639581421d85a4376 (patch)
tree091ec7945d552cf474b7b4471d21e3051ae3f3f7 /fs
parent1bc49d83c37cfaf46be357757e592711e67f9809 (diff)
nfsd: Don't return NFS4ERR_STALE_STATEID for NFSv4.1+
RFC5661 obsoletes NFS4ERR_STALE_STATEID in favour of NFS4ERR_BAD_STATEID. Note that because nfsd encodes the clientid boot time in the stateid, we can hit this error case in certain scenarios where the Linux client state management thread exits early, before it has finished recovering all state. Reported-by: Idan Kedar <idank@primarydata.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfsd/nfs4state.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 451638bb011c..3ba65979a3cd 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -3627,8 +3627,11 @@ static __be32 nfsd4_lookup_stateid(stateid_t *stateid, unsigned char typemask,
3627 return nfserr_bad_stateid; 3627 return nfserr_bad_stateid;
3628 status = lookup_clientid(&stateid->si_opaque.so_clid, sessions, 3628 status = lookup_clientid(&stateid->si_opaque.so_clid, sessions,
3629 nn, &cl); 3629 nn, &cl);
3630 if (status == nfserr_stale_clientid) 3630 if (status == nfserr_stale_clientid) {
3631 if (sessions)
3632 return nfserr_bad_stateid;
3631 return nfserr_stale_stateid; 3633 return nfserr_stale_stateid;
3634 }
3632 if (status) 3635 if (status)
3633 return status; 3636 return status;
3634 *s = find_stateid_by_type(cl, stateid, typemask); 3637 *s = find_stateid_by_type(cl, stateid, typemask);