aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4state.c
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2011-09-02 12:19:43 -0400
committerJ. Bruce Fields <bfields@redhat.com>2011-09-03 05:01:52 -0400
commit68b66e8270f44d297a48662e6aed72c5944f77bd (patch)
treeba5cc61e7dbf505f73a8217ae7409a1e4b3f71c9 /fs/nfsd/nfs4state.c
parent77eaae8d44ec5942033b751d0e0d2914c9411862 (diff)
nfsd4: move double-confirm test to open_confirm
I don't see the point of having this check in nfs4_preprocess_seqid_op() when it's only needed by the one caller. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r--fs/nfsd/nfs4state.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 8694e60a4520..9c44630a245a 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -3434,11 +3434,6 @@ nfs4_preprocess_seqid_op(struct nfsd4_compound_state *cstate, u32 seqid,
3434 if (status) 3434 if (status)
3435 return status; 3435 return status;
3436 3436
3437 if (sop->so_confirmed && flags & CONFIRM) {
3438 dprintk("NFSD: preprocess_seqid_op: expected"
3439 " unconfirmed stateowner!\n");
3440 return nfserr_bad_stateid;
3441 }
3442 if (!sop->so_confirmed && !(flags & CONFIRM)) { 3437 if (!sop->so_confirmed && !(flags & CONFIRM)) {
3443 dprintk("NFSD: preprocess_seqid_op: stateowner not" 3438 dprintk("NFSD: preprocess_seqid_op: stateowner not"
3444 " confirmed yet!\n"); 3439 " confirmed yet!\n");
@@ -3473,9 +3468,11 @@ nfsd4_open_confirm(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
3473 oc->oc_seqid, &oc->oc_req_stateid, 3468 oc->oc_seqid, &oc->oc_req_stateid,
3474 CONFIRM | OPEN_STATE, &stp); 3469 CONFIRM | OPEN_STATE, &stp);
3475 if (status) 3470 if (status)
3476 goto out; 3471 goto out;
3477
3478 sop = stp->st_stateowner; 3472 sop = stp->st_stateowner;
3473 status = nfserr_bad_stateid;
3474 if (sop->so_confirmed)
3475 goto out;
3479 sop->so_confirmed = 1; 3476 sop->so_confirmed = 1;
3480 update_stateid(&stp->st_stateid); 3477 update_stateid(&stp->st_stateid);
3481 memcpy(&oc->oc_resp_stateid, &stp->st_stateid, sizeof(stateid_t)); 3478 memcpy(&oc->oc_resp_stateid, &stp->st_stateid, sizeof(stateid_t));
@@ -3483,6 +3480,7 @@ nfsd4_open_confirm(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
3483 __func__, oc->oc_seqid, STATEID_VAL(&stp->st_stateid)); 3480 __func__, oc->oc_seqid, STATEID_VAL(&stp->st_stateid));
3484 3481
3485 nfsd4_create_clid_dir(sop->so_client); 3482 nfsd4_create_clid_dir(sop->so_client);
3483 status = nfs_ok;
3486out: 3484out:
3487 if (!cstate->replay_owner) 3485 if (!cstate->replay_owner)
3488 nfs4_unlock_state(); 3486 nfs4_unlock_state();