mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 05:44:11 +00:00
nfsd: only fill out return pointer on success in nfsd4_lookup_stateid
[ Upstream commit 4d01416ab4
]
In the case of a revoked delegation, we still fill out the pointer even
when returning an error, which is bad form. Only overwrite the pointer
on success.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
This commit is contained in:
parent
4ad28d583e
commit
ecb0eb07ee
1 changed files with 6 additions and 4 deletions
|
@ -6279,6 +6279,7 @@ nfsd4_lookup_stateid(struct nfsd4_compound_state *cstate,
|
||||||
struct nfs4_stid **s, struct nfsd_net *nn)
|
struct nfs4_stid **s, struct nfsd_net *nn)
|
||||||
{
|
{
|
||||||
__be32 status;
|
__be32 status;
|
||||||
|
struct nfs4_stid *stid;
|
||||||
bool return_revoked = false;
|
bool return_revoked = false;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -6301,15 +6302,16 @@ nfsd4_lookup_stateid(struct nfsd4_compound_state *cstate,
|
||||||
}
|
}
|
||||||
if (status)
|
if (status)
|
||||||
return status;
|
return status;
|
||||||
*s = find_stateid_by_type(cstate->clp, stateid, typemask);
|
stid = find_stateid_by_type(cstate->clp, stateid, typemask);
|
||||||
if (!*s)
|
if (!stid)
|
||||||
return nfserr_bad_stateid;
|
return nfserr_bad_stateid;
|
||||||
if (((*s)->sc_type == NFS4_REVOKED_DELEG_STID) && !return_revoked) {
|
if ((stid->sc_type == NFS4_REVOKED_DELEG_STID) && !return_revoked) {
|
||||||
nfs4_put_stid(*s);
|
nfs4_put_stid(stid);
|
||||||
if (cstate->minorversion)
|
if (cstate->minorversion)
|
||||||
return nfserr_deleg_revoked;
|
return nfserr_deleg_revoked;
|
||||||
return nfserr_bad_stateid;
|
return nfserr_bad_stateid;
|
||||||
}
|
}
|
||||||
|
*s = stid;
|
||||||
return nfs_ok;
|
return nfs_ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue