NFSD: remove redundant variable status

[ Upstream commit 4ab3442ca384a02abf8b1f2b3449a6c547851873 ]

Return value directly from fh_verify() do_open_permission()
exp_pseudoroot() instead of getting value from
redundant variable status.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Jinpeng Cui <cui.jinpeng2@zte.com.cn>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Jinpeng Cui 2022-08-31 14:20:02 +00:00 committed by Ksawlii
parent 1304ec2084
commit 0af51701b1

View file

@ -141,7 +141,6 @@ fh_dup2(struct svc_fh *dst, struct svc_fh *src)
static __be32 static __be32
do_open_permission(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open *open, int accmode) do_open_permission(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open *open, int accmode)
{ {
__be32 status;
if (open->op_truncate && if (open->op_truncate &&
!(open->op_share_access & NFS4_SHARE_ACCESS_WRITE)) !(open->op_share_access & NFS4_SHARE_ACCESS_WRITE))
@ -156,9 +155,7 @@ do_open_permission(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfs
if (open->op_share_deny & NFS4_SHARE_DENY_READ) if (open->op_share_deny & NFS4_SHARE_DENY_READ)
accmode |= NFSD_MAY_WRITE; accmode |= NFSD_MAY_WRITE;
status = fh_verify(rqstp, current_fh, S_IFREG, accmode); return fh_verify(rqstp, current_fh, S_IFREG, accmode);
return status;
} }
static __be32 nfsd_check_obj_isreg(struct svc_fh *fh) static __be32 nfsd_check_obj_isreg(struct svc_fh *fh)
@ -449,7 +446,6 @@ static __be32
do_open_fhandle(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_open *open) do_open_fhandle(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_open *open)
{ {
struct svc_fh *current_fh = &cstate->current_fh; struct svc_fh *current_fh = &cstate->current_fh;
__be32 status;
int accmode = 0; int accmode = 0;
/* We don't know the target directory, and therefore can not /* We don't know the target directory, and therefore can not
@ -474,9 +470,7 @@ do_open_fhandle(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, str
if (open->op_claim_type == NFS4_OPEN_CLAIM_DELEG_CUR_FH) if (open->op_claim_type == NFS4_OPEN_CLAIM_DELEG_CUR_FH)
accmode = NFSD_MAY_OWNER_OVERRIDE; accmode = NFSD_MAY_OWNER_OVERRIDE;
status = do_open_permission(rqstp, current_fh, open, accmode); return do_open_permission(rqstp, current_fh, open, accmode);
return status;
} }
static void static void
@ -663,11 +657,9 @@ static __be32
nfsd4_putrootfh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, nfsd4_putrootfh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
union nfsd4_op_u *u) union nfsd4_op_u *u)
{ {
__be32 status;
fh_put(&cstate->current_fh); fh_put(&cstate->current_fh);
status = exp_pseudoroot(rqstp, &cstate->current_fh);
return status; return exp_pseudoroot(rqstp, &cstate->current_fh);
} }
static __be32 static __be32