aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfsd/nfs4proc.c')
-rw-r--r--fs/nfsd/nfs4proc.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 0166b49fb23e..0972cb33d7d4 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -163,7 +163,7 @@ do_open_fhandle(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_
163 163
164static inline __be32 164static inline __be32
165nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, 165nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
166 struct nfsd4_open *open, struct nfs4_stateowner **replay_owner) 166 struct nfsd4_open *open)
167{ 167{
168 __be32 status; 168 __be32 status;
169 dprintk("NFSD: nfsd4_open filename %.*s op_stateowner %p\n", 169 dprintk("NFSD: nfsd4_open filename %.*s op_stateowner %p\n",
@@ -255,7 +255,7 @@ nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
255out: 255out:
256 if (open->op_stateowner) { 256 if (open->op_stateowner) {
257 nfs4_get_stateowner(open->op_stateowner); 257 nfs4_get_stateowner(open->op_stateowner);
258 *replay_owner = open->op_stateowner; 258 cstate->replay_owner = open->op_stateowner;
259 } 259 }
260 nfs4_unlock_state(); 260 nfs4_unlock_state();
261 return status; 261 return status;
@@ -761,6 +761,7 @@ static void cstate_free(struct nfsd4_compound_state *cstate)
761 return; 761 return;
762 fh_put(&cstate->current_fh); 762 fh_put(&cstate->current_fh);
763 fh_put(&cstate->save_fh); 763 fh_put(&cstate->save_fh);
764 BUG_ON(cstate->replay_owner);
764 kfree(cstate); 765 kfree(cstate);
765} 766}
766 767
@@ -773,6 +774,7 @@ static struct nfsd4_compound_state *cstate_alloc(void)
773 return NULL; 774 return NULL;
774 fh_init(&cstate->current_fh, NFS4_FHSIZE); 775 fh_init(&cstate->current_fh, NFS4_FHSIZE);
775 fh_init(&cstate->save_fh, NFS4_FHSIZE); 776 fh_init(&cstate->save_fh, NFS4_FHSIZE);
777 cstate->replay_owner = NULL;
776 return cstate; 778 return cstate;
777} 779}
778 780
@@ -786,7 +788,6 @@ nfsd4_proc_compound(struct svc_rqst *rqstp,
786{ 788{
787 struct nfsd4_op *op; 789 struct nfsd4_op *op;
788 struct nfsd4_compound_state *cstate = NULL; 790 struct nfsd4_compound_state *cstate = NULL;
789 struct nfs4_stateowner *replay_owner = NULL;
790 int slack_bytes; 791 int slack_bytes;
791 __be32 status; 792 __be32 status;
792 793
@@ -876,7 +877,7 @@ nfsd4_proc_compound(struct svc_rqst *rqstp,
876 break; 877 break;
877 case OP_CLOSE: 878 case OP_CLOSE:
878 op->status = nfsd4_close(rqstp, cstate, 879 op->status = nfsd4_close(rqstp, cstate,
879 &op->u.close, &replay_owner); 880 &op->u.close);
880 break; 881 break;
881 case OP_COMMIT: 882 case OP_COMMIT:
882 op->status = nfsd4_commit(rqstp, cstate, 883 op->status = nfsd4_commit(rqstp, cstate,
@@ -901,15 +902,13 @@ nfsd4_proc_compound(struct svc_rqst *rqstp,
901 op->status = nfsd4_link(rqstp, cstate, &op->u.link); 902 op->status = nfsd4_link(rqstp, cstate, &op->u.link);
902 break; 903 break;
903 case OP_LOCK: 904 case OP_LOCK:
904 op->status = nfsd4_lock(rqstp, cstate, &op->u.lock, 905 op->status = nfsd4_lock(rqstp, cstate, &op->u.lock);
905 &replay_owner);
906 break; 906 break;
907 case OP_LOCKT: 907 case OP_LOCKT:
908 op->status = nfsd4_lockt(rqstp, cstate, &op->u.lockt); 908 op->status = nfsd4_lockt(rqstp, cstate, &op->u.lockt);
909 break; 909 break;
910 case OP_LOCKU: 910 case OP_LOCKU:
911 op->status = nfsd4_locku(rqstp, cstate, &op->u.locku, 911 op->status = nfsd4_locku(rqstp, cstate, &op->u.locku);
912 &replay_owner);
913 break; 912 break;
914 case OP_LOOKUP: 913 case OP_LOOKUP:
915 op->status = nfsd4_lookup(rqstp, cstate, 914 op->status = nfsd4_lookup(rqstp, cstate,
@@ -926,17 +925,15 @@ nfsd4_proc_compound(struct svc_rqst *rqstp,
926 break; 925 break;
927 case OP_OPEN: 926 case OP_OPEN:
928 op->status = nfsd4_open(rqstp, cstate, 927 op->status = nfsd4_open(rqstp, cstate,
929 &op->u.open, &replay_owner); 928 &op->u.open);
930 break; 929 break;
931 case OP_OPEN_CONFIRM: 930 case OP_OPEN_CONFIRM:
932 op->status = nfsd4_open_confirm(rqstp, cstate, 931 op->status = nfsd4_open_confirm(rqstp, cstate,
933 &op->u.open_confirm, 932 &op->u.open_confirm);
934 &replay_owner);
935 break; 933 break;
936 case OP_OPEN_DOWNGRADE: 934 case OP_OPEN_DOWNGRADE:
937 op->status = nfsd4_open_downgrade(rqstp, cstate, 935 op->status = nfsd4_open_downgrade(rqstp, cstate,
938 &op->u.open_downgrade, 936 &op->u.open_downgrade);
939 &replay_owner);
940 break; 937 break;
941 case OP_PUTFH: 938 case OP_PUTFH:
942 op->status = nfsd4_putfh(rqstp, cstate, &op->u.putfh); 939 op->status = nfsd4_putfh(rqstp, cstate, &op->u.putfh);
@@ -1001,16 +998,16 @@ nfsd4_proc_compound(struct svc_rqst *rqstp,
1001 998
1002encode_op: 999encode_op:
1003 if (op->status == nfserr_replay_me) { 1000 if (op->status == nfserr_replay_me) {
1004 op->replay = &replay_owner->so_replay; 1001 op->replay = &cstate->replay_owner->so_replay;
1005 nfsd4_encode_replay(resp, op); 1002 nfsd4_encode_replay(resp, op);
1006 status = op->status = op->replay->rp_status; 1003 status = op->status = op->replay->rp_status;
1007 } else { 1004 } else {
1008 nfsd4_encode_operation(resp, op); 1005 nfsd4_encode_operation(resp, op);
1009 status = op->status; 1006 status = op->status;
1010 } 1007 }
1011 if (replay_owner) { 1008 if (cstate->replay_owner) {
1012 nfs4_put_stateowner(replay_owner); 1009 nfs4_put_stateowner(cstate->replay_owner);
1013 replay_owner = NULL; 1010 cstate->replay_owner = NULL;
1014 } 1011 }
1015 /* XXX Ugh, we need to get rid of this kind of special case: */ 1012 /* XXX Ugh, we need to get rid of this kind of special case: */
1016 if (op->opnum == OP_READ && op->u.read.rd_filp) 1013 if (op->opnum == OP_READ && op->u.read.rd_filp)