From: Chuck Lever III <chuck.lever@oracle.com>
To: "cgel.zte@gmail.com" <cgel.zte@gmail.com>
Cc: Jeff Layton <jlayton@kernel.org>,
Linux NFS Mailing List <linux-nfs@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Jinpeng Cui <cui.jinpeng2@zte.com.cn>,
Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH linux-next] NFSD: remove redundant variable status
Date: Wed, 31 Aug 2022 14:34:36 +0000 [thread overview]
Message-ID: <A854F8D3-3FB3-4B64-9CE0-16FCAE3A7D22@oracle.com> (raw)
In-Reply-To: <20220831142002.304176-1-cui.jinpeng2@zte.com.cn>
> On Aug 31, 2022, at 10:20 AM, cgel.zte@gmail.com wrote:
>
> From: Jinpeng Cui <cui.jinpeng2@zte.com.cn>
>
> 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>
Applied for v6.1. Thanks!
> ---
> fs/nfsd/nfs4proc.c | 16 ++++------------
> 1 file changed, 4 insertions(+), 12 deletions(-)
>
> diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
> index 757d8959f992..7055e1c91d0e 100644
> --- a/fs/nfsd/nfs4proc.c
> +++ b/fs/nfsd/nfs4proc.c
> @@ -141,7 +141,6 @@ fh_dup2(struct svc_fh *dst, struct svc_fh *src)
> static __be32
> do_open_permission(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open *open, int accmode)
> {
> - __be32 status;
>
> if (open->op_truncate &&
> !(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)
> accmode |= NFSD_MAY_WRITE;
>
> - status = fh_verify(rqstp, current_fh, S_IFREG, accmode);
> -
> - return status;
> + return fh_verify(rqstp, current_fh, S_IFREG, accmode);
> }
>
> static __be32 nfsd_check_obj_isreg(struct svc_fh *fh)
> @@ -454,7 +451,6 @@ static __be32
> do_open_fhandle(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_open *open)
> {
> struct svc_fh *current_fh = &cstate->current_fh;
> - __be32 status;
> int accmode = 0;
>
> /* We don't know the target directory, and therefore can not
> @@ -479,9 +475,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)
> accmode = NFSD_MAY_OWNER_OVERRIDE;
>
> - status = do_open_permission(rqstp, current_fh, open, accmode);
> -
> - return status;
> + return do_open_permission(rqstp, current_fh, open, accmode);
> }
>
> static void
> @@ -668,11 +662,9 @@ static __be32
> nfsd4_putrootfh(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
> union nfsd4_op_u *u)
> {
> - __be32 status;
> -
> fh_put(&cstate->current_fh);
> - status = exp_pseudoroot(rqstp, &cstate->current_fh);
> - return status;
> +
> + return exp_pseudoroot(rqstp, &cstate->current_fh);
> }
>
> static __be32
> --
> 2.25.1
>
--
Chuck Lever
prev parent reply other threads:[~2022-08-31 14:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-31 14:20 cgel.zte
2022-08-31 14:34 ` Chuck Lever III [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=A854F8D3-3FB3-4B64-9CE0-16FCAE3A7D22@oracle.com \
--to=chuck.lever@oracle.com \
--cc=cgel.zte@gmail.com \
--cc=cui.jinpeng2@zte.com.cn \
--cc=jlayton@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=zealci@zte.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®