diff options
author | fanchaoting | 2013-04-01 08:07:22 -0500 |
---|---|---|
committer | Greg Kroah-Hartman | 2013-05-07 22:08:23 -0500 |
commit | f1b384b6f67be458dabb31ed1e5938e1b125f5f5 (patch) | |
tree | e54fe97c6d156e3927dc1cda56fa9c54c6d8f30e /fs | |
parent | 73b12d302d65782ea3f072a230c939233f2ab4ec (diff) | |
download | kernel-video-f1b384b6f67be458dabb31ed1e5938e1b125f5f5.tar.gz kernel-video-f1b384b6f67be458dabb31ed1e5938e1b125f5f5.tar.xz kernel-video-f1b384b6f67be458dabb31ed1e5938e1b125f5f5.zip |
nfsd: don't run get_file if nfs4_preprocess_stateid_op return error
commit b022032e195ffca83d7002d6b84297d796ed443b upstream.
we should return error status directly when nfs4_preprocess_stateid_op
return error.
Signed-off-by: fanchaoting <fanchaoting@cn.fujitsu.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfsd/nfs4proc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 9d1c5dba2bb..ec668e1283c 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c | |||
@@ -931,14 +931,14 @@ nfsd4_write(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
931 | nfs4_lock_state(); | 931 | nfs4_lock_state(); |
932 | status = nfs4_preprocess_stateid_op(SVC_NET(rqstp), | 932 | status = nfs4_preprocess_stateid_op(SVC_NET(rqstp), |
933 | cstate, stateid, WR_STATE, &filp); | 933 | cstate, stateid, WR_STATE, &filp); |
934 | if (filp) | ||
935 | get_file(filp); | ||
936 | nfs4_unlock_state(); | ||
937 | |||
938 | if (status) { | 934 | if (status) { |
935 | nfs4_unlock_state(); | ||
939 | dprintk("NFSD: nfsd4_write: couldn't process stateid!\n"); | 936 | dprintk("NFSD: nfsd4_write: couldn't process stateid!\n"); |
940 | return status; | 937 | return status; |
941 | } | 938 | } |
939 | if (filp) | ||
940 | get_file(filp); | ||
941 | nfs4_unlock_state(); | ||
942 | 942 | ||
943 | cnt = write->wr_buflen; | 943 | cnt = write->wr_buflen; |
944 | write->wr_how_written = write->wr_stable_how; | 944 | write->wr_how_written = write->wr_stable_how; |