diff options
author | J. Bruce Fields <bfields@redhat.com> | 2012-06-07 17:30:45 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2012-06-20 08:59:43 -0400 |
commit | 4af825041b06c2ef9b5933288267a11e029eb360 (patch) | |
tree | 508bfc564e44e62586a81c8aeb34d6f9ac249072 /fs/nfsd/nfs4state.c | |
parent | e1aaa8916f19d23d39d88e985bc6933a74159e91 (diff) |
nfsd4: process_open2 cleanup
Note we can simplify the error handling a little by doing the truncate
earlier.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r-- | fs/nfsd/nfs4state.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index de8f7e45102d..9efa4055b5a8 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -3013,14 +3013,12 @@ nfsd4_process_open2(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nf | |||
3013 | status = nfs4_get_vfs_file(rqstp, fp, current_fh, open); | 3013 | status = nfs4_get_vfs_file(rqstp, fp, current_fh, open); |
3014 | if (status) | 3014 | if (status) |
3015 | goto out; | 3015 | goto out; |
3016 | status = nfsd4_truncate(rqstp, current_fh, open); | ||
3017 | if (status) | ||
3018 | goto out; | ||
3016 | stp = open->op_stp; | 3019 | stp = open->op_stp; |
3017 | open->op_stp = NULL; | 3020 | open->op_stp = NULL; |
3018 | init_open_stateid(stp, fp, open); | 3021 | init_open_stateid(stp, fp, open); |
3019 | status = nfsd4_truncate(rqstp, current_fh, open); | ||
3020 | if (status) { | ||
3021 | release_open_stateid(stp); | ||
3022 | goto out; | ||
3023 | } | ||
3024 | } | 3022 | } |
3025 | update_stateid(&stp->st_stid.sc_stateid); | 3023 | update_stateid(&stp->st_stid.sc_stateid); |
3026 | memcpy(&open->op_stateid, &stp->st_stid.sc_stateid, sizeof(stateid_t)); | 3024 | memcpy(&open->op_stateid, &stp->st_stid.sc_stateid, sizeof(stateid_t)); |