aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4state.c
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2013-03-12 17:36:17 -0400
committerJ. Bruce Fields <bfields@redhat.com>2013-04-03 11:48:35 -0400
commit0eb6f20aa532b0c16849d627926c2ad3fe2f1cdf (patch)
tree72cfd48dcbb467f2cabfbd37c973526f358c21f7 /fs/nfsd/nfs4state.c
parent78389046f733564d5c2c94f0b8d6ff0cdae951d9 (diff)
nfsd4: STALE_STATEID cleanup
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r--fs/nfsd/nfs4state.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index ef7c6222b7c8..a0ab6ad7239d 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -3282,16 +3282,6 @@ static inline __be32 nfs4_check_fh(struct svc_fh *fhp, struct nfs4_ol_stateid *s
3282 return nfs_ok; 3282 return nfs_ok;
3283} 3283}
3284 3284
3285static int
3286STALE_STATEID(stateid_t *stateid, struct nfsd_net *nn)
3287{
3288 if (stateid->si_opaque.so_clid.cl_boot == nn->boot_time)
3289 return 0;
3290 dprintk("NFSD: stale stateid " STATEID_FMT "!\n",
3291 STATEID_VAL(stateid));
3292 return 1;
3293}
3294
3295static inline int 3285static inline int
3296access_permit_read(struct nfs4_ol_stateid *stp) 3286access_permit_read(struct nfs4_ol_stateid *stp)
3297{ 3287{
@@ -3422,19 +3412,20 @@ static __be32 nfsd4_lookup_stateid(stateid_t *stateid, unsigned char typemask,
3422 struct nfsd_net *nn) 3412 struct nfsd_net *nn)
3423{ 3413{
3424 struct nfs4_client *cl; 3414 struct nfs4_client *cl;
3415 __be32 status;
3425 3416
3426 if (ZERO_STATEID(stateid) || ONE_STATEID(stateid)) 3417 if (ZERO_STATEID(stateid) || ONE_STATEID(stateid))
3427 return nfserr_bad_stateid; 3418 return nfserr_bad_stateid;
3428 if (STALE_STATEID(stateid, nn)) 3419 status = lookup_clientid(&stateid->si_opaque.so_clid, sessions,
3420 nn, &cl);
3421 if (status == nfserr_stale_clientid)
3429 return nfserr_stale_stateid; 3422 return nfserr_stale_stateid;
3430 cl = find_confirmed_client(&stateid->si_opaque.so_clid, sessions, nn); 3423 if (status)
3431 if (!cl) 3424 return status;
3432 return nfserr_expired;
3433 *s = find_stateid_by_type(cl, stateid, typemask); 3425 *s = find_stateid_by_type(cl, stateid, typemask);
3434 if (!*s) 3426 if (!*s)
3435 return nfserr_bad_stateid; 3427 return nfserr_bad_stateid;
3436 return nfs_ok; 3428 return nfs_ok;
3437
3438} 3429}
3439 3430
3440/* 3431/*