aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2011-09-26 12:53:00 -0400
committerJ. Bruce Fields <bfields@redhat.com>2011-09-26 17:35:27 -0400
commit36279ac10c3d69372af875f1affafd375db687a9 (patch)
tree64b9fee1c1795a80f2ca9bc7730fa3b2eec0a2d9 /fs/nfsd
parent6136d2b409652b064b2da6d43d5c47cbd1d2cc14 (diff)
nfsd4: assume test_stateid always has session
Test_stateid is 4.1-only and only allowed after a sequence operation, so this check is unnecessary. Cc: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/nfs4state.c6
-rw-r--r--fs/nfsd/nfs4xdr.c2
-rw-r--r--fs/nfsd/state.h2
-rw-r--r--fs/nfsd/xdr4.h1
4 files changed, 5 insertions, 6 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index a9e71cdf4a84..daf75fa4c027 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -3256,7 +3256,7 @@ static int check_stateid_generation(stateid_t *in, stateid_t *ref, bool has_sess
3256 return nfserr_old_stateid; 3256 return nfserr_old_stateid;
3257} 3257}
3258 3258
3259__be32 nfs4_validate_stateid(stateid_t *stateid, bool has_session) 3259__be32 nfs4_validate_stateid(stateid_t *stateid)
3260{ 3260{
3261 struct nfs4_stid *s; 3261 struct nfs4_stid *s;
3262 struct nfs4_ol_stateid *ols; 3262 struct nfs4_ol_stateid *ols;
@@ -3268,7 +3268,7 @@ __be32 nfs4_validate_stateid(stateid_t *stateid, bool has_session)
3268 s = find_stateid(stateid); 3268 s = find_stateid(stateid);
3269 if (!s) 3269 if (!s)
3270 return nfserr_stale_stateid; 3270 return nfserr_stale_stateid;
3271 status = check_stateid_generation(stateid, &s->sc_stateid, has_session); 3271 status = check_stateid_generation(stateid, &s->sc_stateid, 1);
3272 if (status) 3272 if (status)
3273 return status; 3273 return status;
3274 if (!(s->sc_type & (NFS4_OPEN_STID | NFS4_LOCK_STID))) 3274 if (!(s->sc_type & (NFS4_OPEN_STID | NFS4_LOCK_STID)))
@@ -3374,7 +3374,7 @@ __be32
3374nfsd4_test_stateid(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 3374nfsd4_test_stateid(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
3375 struct nfsd4_test_stateid *test_stateid) 3375 struct nfsd4_test_stateid *test_stateid)
3376{ 3376{
3377 test_stateid->ts_has_session = nfsd4_has_session(cstate); 3377 /* real work is done during encoding */
3378 return nfs_ok; 3378 return nfs_ok;
3379} 3379}
3380 3380
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 7bd57c2dbc4d..2429fffa31dd 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -3302,7 +3302,7 @@ nfsd4_encode_test_stateid(struct nfsd4_compoundres *resp, int nfserr,
3302 nfs4_lock_state(); 3302 nfs4_lock_state();
3303 for (i = 0; i < test_stateid->ts_num_ids; i++) { 3303 for (i = 0; i < test_stateid->ts_num_ids; i++) {
3304 nfsd4_decode_stateid(argp, &si); 3304 nfsd4_decode_stateid(argp, &si);
3305 valid = nfs4_validate_stateid(&si, test_stateid->ts_has_session); 3305 valid = nfs4_validate_stateid(&si);
3306 RESERVE_SPACE(4); 3306 RESERVE_SPACE(4);
3307 *p++ = htonl(valid); 3307 *p++ = htonl(valid);
3308 resp->p = p; 3308 resp->p = p;
diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h
index 3ed5f99141ec..55a4d6a108a2 100644
--- a/fs/nfsd/state.h
+++ b/fs/nfsd/state.h
@@ -508,7 +508,7 @@ extern void nfsd4_recdir_purge_old(void);
508extern int nfsd4_create_clid_dir(struct nfs4_client *clp); 508extern int nfsd4_create_clid_dir(struct nfs4_client *clp);
509extern void nfsd4_remove_clid_dir(struct nfs4_client *clp); 509extern void nfsd4_remove_clid_dir(struct nfs4_client *clp);
510extern void release_session_client(struct nfsd4_session *); 510extern void release_session_client(struct nfsd4_session *);
511extern __be32 nfs4_validate_stateid(stateid_t *, bool); 511extern __be32 nfs4_validate_stateid(stateid_t *);
512extern void nfsd4_purge_closed_stateid(struct nfs4_stateowner *); 512extern void nfsd4_purge_closed_stateid(struct nfs4_stateowner *);
513 513
514#endif /* NFSD4_STATE_H */ 514#endif /* NFSD4_STATE_H */
diff --git a/fs/nfsd/xdr4.h b/fs/nfsd/xdr4.h
index a767b57b8208..c9012149637c 100644
--- a/fs/nfsd/xdr4.h
+++ b/fs/nfsd/xdr4.h
@@ -343,7 +343,6 @@ struct nfsd4_saved_compoundargs {
343 343
344struct nfsd4_test_stateid { 344struct nfsd4_test_stateid {
345 __be32 ts_num_ids; 345 __be32 ts_num_ids;
346 bool ts_has_session;
347 struct nfsd4_compoundargs *ts_saved_args; 346 struct nfsd4_compoundargs *ts_saved_args;
348 struct nfsd4_saved_compoundargs ts_savedp; 347 struct nfsd4_saved_compoundargs ts_savedp;
349}; 348};