Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4af82504 authored by J. Bruce Fields's avatar J. Bruce Fields
Browse files

nfsd4: process_open2 cleanup



Note we can simplify the error handling a little by doing the truncate
earlier.

Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent e1aaa891
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -3011,16 +3011,14 @@ nfsd4_process_open2(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nf
			goto out;
	} else {
		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));