Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp6441376rwp; Mon, 17 Jul 2023 23:44:14 -0700 (PDT) X-Google-Smtp-Source: APBJJlGYG6Vq37yBNWLh9oonwcByenfwTPmTzKzGj/q+cEML711mPb2Sr/FudxYTTkpKXV0makJF X-Received: by 2002:aa7:c149:0:b0:51d:d37f:ab49 with SMTP id r9-20020aa7c149000000b0051dd37fab49mr10125424edp.6.1689662654452; Mon, 17 Jul 2023 23:44:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689662654; cv=none; d=google.com; s=arc-20160816; b=nHzAaNqKEcwgZxt7XBsEWMjN8KMS/gIwceYKIS1QaGcIlsnDV7JSjaasHIBMzjTLqX 3DgUy2XBPymlCW1HvYtEJzb0Spe6NYm1O1EG2kgp0R7wJl2gY4CK7CP2+LpKGKQhJjvc mcFf3FHxAVu5xmY3j8DpjDdfyHme/U0mqL6O2xk7dHOnzc2ZOCwfpNYOqloWSdeOkXRD /aRpkw/TeJsIQqfUsCccmI4Ldu/xceZNNgJqihB1ilra3pNiglVauw0RM02dcJ1Pk9XX ifnYTB630JucXzYiZUMo6VmWXj2gguYhMesr2CkrxflDvN2aCLML5OBXoknpqoNBzqiP ys/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject:dkim-signature:dkim-signature; bh=/t/y/epzgmGxfN8+0Nclw0tUxGKxQ6msbvf5pN6rITY=; fh=BG1K0WrNCDl2IiSLnDtgJLHPQBaNsmsTJjqgDAImPg0=; b=RTi6fLTktssWVGtzNmPrXMt+h6j6FHO5rrJU2G/Rms3W4WoUvx+OVusY82Ty0f11IK qEJ/6DjQSpX0oPMMykgpUvRs+4chL5JyYLKEWE14rxKPOGYaldpvtkhsD2nQRDofrvcV u04jsWNHe7F1M5eWTcbgvjLkJJ2QCxDeUTo6utqZ5nKcq89JST4BdpZbJc8YIPCbUb0Q +Xlmq07PZXqlKf1F5kCgHh80tktRRLd+WPH5st5bXO7Nub0a5NMfNZytfcjmmCgu7Xem fjt1TvwLidEx/8vw0ApcsjdG5ue/fowNb+ZtX1hv2F3j0YSjQUDdkKh9WWPtbomGX3fp YsYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=KT1iROBx; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y7-20020a50e607000000b0051e0c9dc478si732313edm.682.2023.07.17.23.43.38; Mon, 17 Jul 2023 23:44:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=KT1iROBx; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231416AbjGRGjU (ORCPT + 99 others); Tue, 18 Jul 2023 02:39:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231360AbjGRGjR (ORCPT ); Tue, 18 Jul 2023 02:39:17 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83213198 for ; Mon, 17 Jul 2023 23:39:16 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 3E6E62197F; Tue, 18 Jul 2023 06:39:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1689662355; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/t/y/epzgmGxfN8+0Nclw0tUxGKxQ6msbvf5pN6rITY=; b=KT1iROBxlr0NZRiLk45c56E2Vj5nGQQJbSFqCiyo/96bzNx1gmuRwAd8nCs5opgPgTkZf7 l57GX7cxVE9sdTs7ZZddMhHJliJzrw8Vn9DDats/RuYeEI1jOcj4yb8WA3GPuu4K829gAj FROkT/XpWt1SHZH23P4Imp4jxYOm/ig= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1689662355; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/t/y/epzgmGxfN8+0Nclw0tUxGKxQ6msbvf5pN6rITY=; b=N0dtvTE0YJ1eC1B/YzzkfW0daALG9zpi1nhqkKWE1M0x5KAP0DGkqFKR//AhKRb5tIceXh WMRgZ3Wk1kWC3cCQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id D2C4213494; Tue, 18 Jul 2023 06:39:13 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id oKYVIZEztmRBDAAAMHmgww (envelope-from ); Tue, 18 Jul 2023 06:39:13 +0000 Subject: [PATCH 03/14] SUNRPC: call svc_process() from svc_recv(). From: NeilBrown To: Chuck Lever , Jeff Layton Cc: linux-nfs@vger.kernel.org Date: Tue, 18 Jul 2023 16:38:08 +1000 Message-ID: <168966228861.11075.6512110736168003985.stgit@noble.brown> In-Reply-To: <168966227838.11075.2974227708495338626.stgit@noble.brown> References: <168966227838.11075.2974227708495338626.stgit@noble.brown> User-Agent: StGit/1.5 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org 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 --- 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);