linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: NeilBrown <neilb@suse.de>, Chuck Lever <chuck.lever@oracle.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH 03/14] SUNRPC: call svc_process() from svc_recv().
Date: Thu, 20 Jul 2023 16:07:16 -0400	[thread overview]
Message-ID: <80105dc67e90c5187ba24247a6ccf9454b44258f.camel@kernel.org> (raw)
In-Reply-To: <168966228861.11075.6512110736168003985.stgit@noble.brown>

On Tue, 2023-07-18 at 16:38 +1000, NeilBrown wrote:
> All callers of svc_recv() go on to call svc_process() on success.
> Simplify callers by having svc_recv() do that for them.
> 
> This loses one call to validate_process_creds() in nfsd.  That was
> debugging code added 14 years ago.  I don't think we need to keep it.
> 
> Signed-off-by: NeilBrown <neilb@suse.de>
> ---
>  fs/lockd/svc.c        |    5 -----
>  fs/nfs/callback.c     |    1 -
>  fs/nfsd/nfssvc.c      |    2 --
>  net/sunrpc/svc_xprt.c |    3 ++-
>  4 files changed, 2 insertions(+), 9 deletions(-)
> 
> diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c
> index 614faa5f69cd..91ef139a7757 100644
> --- a/fs/lockd/svc.c
> +++ b/fs/lockd/svc.c
> @@ -132,7 +132,6 @@ lockd(void *vrqstp)
>  	 */
>  	while (!kthread_should_stop()) {
>  		long timeout = MAX_SCHEDULE_TIMEOUT;
> -		RPC_IFDEBUG(char buf[RPC_MAX_ADDRBUFLEN]);
>  
>  		/* update sv_maxconn if it has changed */
>  		rqstp->rq_server->sv_maxconn = nlm_max_connections;
> @@ -146,10 +145,6 @@ lockd(void *vrqstp)
>  		err = svc_recv(rqstp, timeout);
>  		if (err == -EAGAIN || err == -EINTR)
>  			continue;
> -		dprintk("lockd: request from %s\n",
> -				svc_print_addr(rqstp, buf, sizeof(buf)));
> -
> -		svc_process(rqstp);
>  	}
>  	if (nlmsvc_ops)
>  		nlmsvc_invalidate_all();
> diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c
> index 46a0a2d6962e..2d94384bd6a9 100644
> --- a/fs/nfs/callback.c
> +++ b/fs/nfs/callback.c
> @@ -86,7 +86,6 @@ nfs4_callback_svc(void *vrqstp)
>  		err = svc_recv(rqstp, MAX_SCHEDULE_TIMEOUT);
>  		if (err == -EAGAIN || err == -EINTR)
>  			continue;
> -		svc_process(rqstp);
>  	}
>  
>  	svc_exit_thread(rqstp);
> diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
> index 439fca195925..3e08cc746870 100644
> --- a/fs/nfsd/nfssvc.c
> +++ b/fs/nfsd/nfssvc.c
> @@ -985,8 +985,6 @@ nfsd(void *vrqstp)
>  		if (err == -EINTR)
>  			break;
>  		validate_process_creds();
> -		svc_process(rqstp);
> -		validate_process_creds();
>  	}
>  
>  	atomic_dec(&nfsdstats.th_cnt);
> diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
> index 93395606a0ba..c808f6d60c99 100644
> --- a/net/sunrpc/svc_xprt.c
> +++ b/net/sunrpc/svc_xprt.c
> @@ -895,7 +895,8 @@ int svc_recv(struct svc_rqst *rqstp, long timeout)
>  		serv->sv_stats->netcnt++;
>  	percpu_counter_inc(&rqstp->rq_pool->sp_messages_arrived);
>  	rqstp->rq_stime = ktime_get();
> -	return len;
> +	svc_process(rqstp);
> +	return 0;
>  out_release:
>  	rqstp->rq_res.len = 0;
>  	svc_xprt_release(rqstp);
> 
> 

Reviewed-by: Jeff Layton <jlayton@kernel.org>

  reply	other threads:[~2023-07-20 20:07 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-18  6:38 [PATCH 00/14] Refactor SUNRPC svc thread code, and use llist NeilBrown
2023-07-18  6:38 ` [PATCH 12/14] SUNRPC: discard SP_CONGESTED NeilBrown
2023-07-18  6:38 ` [PATCH 01/14] lockd: remove SIGKILL handling NeilBrown
2023-07-20 20:05   ` Jeff Layton
2023-07-18  6:38 ` [PATCH 14/14] SUNRPC: only have one thread waking up at a time NeilBrown
2023-07-18  6:38 ` [PATCH 13/14] SUNRPC: change service idle list to be an llist NeilBrown
2023-07-18  6:38 ` [PATCH 05/14] SUNRPC: remove timeout arg from svc_recv() NeilBrown
2023-07-20 20:12   ` Jeff Layton
2023-07-18  6:38 ` [PATCH 06/14] SUNRPC: change various server-side #defines to enum NeilBrown
2023-07-18 13:37   ` Chuck Lever
2023-07-30 15:57     ` Chuck Lever
2023-07-30 22:11       ` NeilBrown
2023-07-30 22:14         ` NeilBrown
2023-07-30 22:16           ` Chuck Lever III
2023-07-30 22:56       ` NeilBrown
2023-07-30 22:57         ` Chuck Lever III
2023-07-30 23:19       ` Chuck Lever III
2023-07-18  6:38 ` [PATCH 07/14] SUNRPC: refactor svc_recv() NeilBrown
2023-07-18 13:49   ` Chuck Lever
2023-07-18  6:38 ` [PATCH 11/14] SUNRPC: add list of idle threads NeilBrown
2023-07-18  6:38 ` [PATCH 09/14] SUNRPC: change how svc threads are asked to exit NeilBrown
2023-07-20 20:30   ` Jeff Layton
2023-07-20 21:32     ` NeilBrown
2023-07-18  6:38 ` [PATCH 02/14] nfsd: don't allow nfsd threads to be signalled NeilBrown
2023-07-20 20:05   ` Jeff Layton
2023-07-18  6:38 ` [PATCH 10/14] SUNRPC: change svc_pool_wake_idle_thread() to return nothing NeilBrown
2023-07-18 13:58   ` Chuck Lever
2023-07-19  1:16     ` NeilBrown
2023-07-19 13:12       ` Chuck Lever III
2023-07-19 23:20         ` NeilBrown
2023-07-19 23:44           ` Chuck Lever III
2023-07-20 14:29             ` Chuck Lever III
2023-07-24  0:03               ` NeilBrown
2023-07-24  4:44               ` NeilBrown
2023-07-25 13:49                 ` Chuck Lever III
2023-07-18  6:38 ` [PATCH 08/14] SUNRPC: integrate back-channel processing with svc_recv() and svc_process() NeilBrown
2023-07-20 20:16   ` Jeff Layton
2023-07-18  6:38 ` [PATCH 04/14] SUNRPC: change svc_recv() to return void NeilBrown
2023-07-18 13:26   ` Chuck Lever
2023-07-20 20:02   ` Jeff Layton
2023-07-18  6:38 ` [PATCH 03/14] SUNRPC: call svc_process() from svc_recv() NeilBrown
2023-07-20 20:07   ` Jeff Layton [this message]
2023-07-18 18:12 ` [PATCH 00/14] Refactor SUNRPC svc thread code, and use llist Chuck Lever III

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=80105dc67e90c5187ba24247a6ccf9454b44258f.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    /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;
as well as URLs for NNTP newsgroup(s).