aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd
diff options
context:
space:
mode:
authorfanchaoting <fanchaoting@cn.fujitsu.com>2013-04-01 09:07:22 -0400
committerJ. Bruce Fields <bfields@redhat.com>2013-04-03 15:19:06 -0400
commitb022032e195ffca83d7002d6b84297d796ed443b (patch)
treeecbcc134db21887d908ec979c393d724dce52407 /fs/nfsd
parent89876f8c0dbcc2947b13b9e22cf28c5308cee3c1 (diff)
nfsd: don't run get_file if nfs4_preprocess_stateid_op return error
we should return error status directly when nfs4_preprocess_stateid_op return error. Signed-off-by: fanchaoting <fanchaoting@cn.fujitsu.com> Cc: stable@vger.kernel.org Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/nfs4proc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 42c498ce9f0e..a9b707b23858 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -953,14 +953,14 @@ nfsd4_write(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
953 nfs4_lock_state(); 953 nfs4_lock_state();
954 status = nfs4_preprocess_stateid_op(SVC_NET(rqstp), 954 status = nfs4_preprocess_stateid_op(SVC_NET(rqstp),
955 cstate, stateid, WR_STATE, &filp); 955 cstate, stateid, WR_STATE, &filp);
956 if (filp)
957 get_file(filp);
958 nfs4_unlock_state();
959
960 if (status) { 956 if (status) {
957 nfs4_unlock_state();
961 dprintk("NFSD: nfsd4_write: couldn't process stateid!\n"); 958 dprintk("NFSD: nfsd4_write: couldn't process stateid!\n");
962 return status; 959 return status;
963 } 960 }
961 if (filp)
962 get_file(filp);
963 nfs4_unlock_state();
964 964
965 cnt = write->wr_buflen; 965 cnt = write->wr_buflen;
966 write->wr_how_written = write->wr_stable_how; 966 write->wr_how_written = write->wr_stable_how;