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

Commit e17f99b7 authored by Trond Myklebust's avatar Trond Myklebust Committed by J. Bruce Fields
Browse files

nfsd: nfs4_preprocess_seqid_op should only set *stpp on success



Not technically a bugfix, since nothing tries to use the return pointer
if this function doesn't return success, but it could be a problem
with some coming changes.

Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: default avatarJeff Layton <jlayton@primarydata.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 5b8db00b
Loading
Loading
Loading
Loading
+7 −3
Original line number Original line Diff line number Diff line
@@ -3953,6 +3953,7 @@ nfs4_preprocess_seqid_op(struct nfsd4_compound_state *cstate, u32 seqid,
{
{
	__be32 status;
	__be32 status;
	struct nfs4_stid *s;
	struct nfs4_stid *s;
	struct nfs4_ol_stateid *stp = NULL;


	dprintk("NFSD: %s: seqid=%d stateid = " STATEID_FMT "\n", __func__,
	dprintk("NFSD: %s: seqid=%d stateid = " STATEID_FMT "\n", __func__,
		seqid, STATEID_VAL(stateid));
		seqid, STATEID_VAL(stateid));
@@ -3962,11 +3963,14 @@ nfs4_preprocess_seqid_op(struct nfsd4_compound_state *cstate, u32 seqid,
				      cstate->minorversion, nn);
				      cstate->minorversion, nn);
	if (status)
	if (status)
		return status;
		return status;
	*stpp = openlockstateid(s);
	stp = openlockstateid(s);
	if (!nfsd4_has_session(cstate))
	if (!nfsd4_has_session(cstate))
		cstate->replay_owner = (*stpp)->st_stateowner;
		cstate->replay_owner = stp->st_stateowner;


	return nfs4_seqid_op_checks(cstate, stateid, seqid, *stpp);
	status = nfs4_seqid_op_checks(cstate, stateid, seqid, stp);
	if (!status)
		*stpp = stp;
	return status;
}
}


static __be32 nfs4_preprocess_confirmed_seqid_op(struct nfsd4_compound_state *cstate, u32 seqid,
static __be32 nfs4_preprocess_confirmed_seqid_op(struct nfsd4_compound_state *cstate, u32 seqid,