diff options
author | Tigran Mkrtchyan <kofemann@gmail.com> | 2012-02-13 16:55:32 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2012-02-15 11:20:45 -0500 |
commit | 37c593c57324740821766c56e48cf09776a68a9c (patch) | |
tree | 9c6f91acb532da56f5d5f24c2aa8a345f717c81a /fs/nfsd/nfs4proc.c | |
parent | 9428fe1abb672c67169d3b6abf0faa120f020c32 (diff) |
nfsd41: use current stateid by value
Signed-off-by: Tigran Mkrtchyan <kofemann@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4proc.c')
-rw-r--r-- | fs/nfsd/nfs4proc.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 1ee0e7c42e97..53636ff0e6ae 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c | |||
@@ -453,7 +453,10 @@ nfsd4_restorefh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
453 | return nfserr_restorefh; | 453 | return nfserr_restorefh; |
454 | 454 | ||
455 | fh_dup2(&cstate->current_fh, &cstate->save_fh); | 455 | fh_dup2(&cstate->current_fh, &cstate->save_fh); |
456 | cstate->current_stateid = cstate->save_stateid; | 456 | if (HAS_STATE_ID(cstate, SAVED_STATE_ID_FLAG)) { |
457 | memcpy(&cstate->current_stateid, &cstate->save_stateid, sizeof(stateid_t)); | ||
458 | SET_STATE_ID(cstate, CURRENT_STATE_ID_FLAG); | ||
459 | } | ||
457 | return nfs_ok; | 460 | return nfs_ok; |
458 | } | 461 | } |
459 | 462 | ||
@@ -465,7 +468,10 @@ nfsd4_savefh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
465 | return nfserr_nofilehandle; | 468 | return nfserr_nofilehandle; |
466 | 469 | ||
467 | fh_dup2(&cstate->save_fh, &cstate->current_fh); | 470 | fh_dup2(&cstate->save_fh, &cstate->current_fh); |
468 | cstate->save_stateid = cstate->current_stateid; | 471 | if (HAS_STATE_ID(cstate, CURRENT_STATE_ID_FLAG)) { |
472 | memcpy(&cstate->save_stateid, &cstate->current_stateid, sizeof(stateid_t)); | ||
473 | SET_STATE_ID(cstate, SAVED_STATE_ID_FLAG); | ||
474 | } | ||
469 | return nfs_ok; | 475 | return nfs_ok; |
470 | } | 476 | } |
471 | 477 | ||
@@ -1238,7 +1244,7 @@ nfsd4_proc_compound(struct svc_rqst *rqstp, | |||
1238 | opdesc->op_set_currentstateid(cstate, &op->u); | 1244 | opdesc->op_set_currentstateid(cstate, &op->u); |
1239 | 1245 | ||
1240 | if (opdesc->op_flags & OP_CLEAR_STATEID) | 1246 | if (opdesc->op_flags & OP_CLEAR_STATEID) |
1241 | cstate->current_stateid = NULL; | 1247 | clear_current_stateid(cstate); |
1242 | 1248 | ||
1243 | if (need_wrongsec_check(rqstp)) | 1249 | if (need_wrongsec_check(rqstp)) |
1244 | op->status = check_nfsd_access(cstate->current_fh.fh_export, rqstp); | 1250 | op->status = check_nfsd_access(cstate->current_fh.fh_export, rqstp); |