summaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4state.c
diff options
context:
space:
mode:
authorTrond Myklebust2014-06-30 17:48:34 +0200
committerJ. Bruce Fields2014-07-08 23:14:33 +0200
commite17f99b728006fcebcf025b32fa7370bb998fb81 (patch)
tree622d0ed866a72be76f80d846d91de7ff27163249 /fs/nfsd/nfs4state.c
parentnfsd: add a new /proc/fs/nfsd/max_connections file (diff)
downloadkernel-qcow2-linux-e17f99b728006fcebcf025b32fa7370bb998fb81.tar.gz
kernel-qcow2-linux-e17f99b728006fcebcf025b32fa7370bb998fb81.tar.xz
kernel-qcow2-linux-e17f99b728006fcebcf025b32fa7370bb998fb81.zip
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: Trond Myklebust <trond.myklebust@primarydata.com> Signed-off-by: Jeff Layton <jlayton@primarydata.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r--fs/nfsd/nfs4state.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 29788fd0da24..71c442fb9b3e 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -3953,6 +3953,7 @@ nfs4_preprocess_seqid_op(struct nfsd4_compound_state *cstate, u32 seqid,
{
__be32 status;
struct nfs4_stid *s;
+ struct nfs4_ol_stateid *stp = NULL;
dprintk("NFSD: %s: seqid=%d stateid = " STATEID_FMT "\n", __func__,
seqid, STATEID_VAL(stateid));
@@ -3962,11 +3963,14 @@ nfs4_preprocess_seqid_op(struct nfsd4_compound_state *cstate, u32 seqid,
cstate->minorversion, nn);
if (status)
return status;
- *stpp = openlockstateid(s);
+ stp = openlockstateid(s);
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,