diff options
author | J. Bruce Fields <bfields@redhat.com> | 2012-06-07 21:30:45 (GMT) |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2012-06-20 12:59:43 (GMT) |
commit | 4af825041b06c2ef9b5933288267a11e029eb360 (patch) | |
tree | 508bfc564e44e62586a81c8aeb34d6f9ac249072 /fs/nfsd | |
parent | e1aaa8916f19d23d39d88e985bc6933a74159e91 (diff) | |
download | linux-4af825041b06c2ef9b5933288267a11e029eb360.tar.xz |
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')
-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 de8f7e4..9efa405 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 status = nfs4_get_vfs_file(rqstp, fp, current_fh, open); if (status) goto out; + status = nfsd4_truncate(rqstp, current_fh, open); + if (status) + goto out; stp = open->op_stp; open->op_stp = NULL; init_open_stateid(stp, fp, open); - status = nfsd4_truncate(rqstp, current_fh, open); - if (status) { - release_open_stateid(stp); - goto out; - } } update_stateid(&stp->st_stid.sc_stateid); memcpy(&open->op_stateid, &stp->st_stid.sc_stateid, sizeof(stateid_t)); |