Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp5110599rwl; Sun, 8 Jan 2023 08:45:00 -0800 (PST) X-Google-Smtp-Source: AMrXdXsu+fNENiwSz5myCrvGSZk+AcvjzXrZ6ziCmk94Asn1bI8YthVCLIDu/GIGP2TtFX0vCxmp X-Received: by 2002:a17:907:8b11:b0:81b:fbff:a7cc with SMTP id sz17-20020a1709078b1100b0081bfbffa7ccmr52863494ejc.18.1673196299914; Sun, 08 Jan 2023 08:44:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673196299; cv=none; d=google.com; s=arc-20160816; b=qWt59lu1xgl/MgX9rkfYuJrHkQc2/ckfuqdLFakAIDTzK2gBuLWxF0YV3lrDuHw5bM lvBmOtrBKx49weLy2MnancMwmgLPj8LkWoAFOsNoPW2wgz5AbAEjzvD/m1iEHjggoKK/ 5W54sDr3oiIfuZ/mMfGayA70MR/FyXRrLLke/bb/6v1lWaBAE1avJH1qTUmtmokB0uWW U2T79bGR+GViv9S9ytAKhL9+N/a0ZOQfpUL0L8fyPbEZm9igOzxkJ3v0r+RVCU28W/ae fAm7L6TTpjrp7xHdH4uGvJ2HXHxefA6dcmZvg4vLTbFLdrMrjFhaMt9hZq/EyWLHA3i2 vdZg== 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:to:from:subject :dkim-signature; bh=Hn+9+B+Q8wb1xryhJJveSO2uXIwZjl1WEQahqDLP+fY=; b=lWCGWjxjeyAYhoxMBW7UQfI3xRy7lNNmJ9HXSkvX/nnEmBovzC3m8ld7FaChDT4SVH tbjfL2hFxDrCW8j6Di6I6eV4w6LEZ+5e5EDnFje7G+9e1NgOmUMGf1s6wctUKVeEaTKN wGbwiVCOLt2E3fWnb0MiTyBak1G4BhhxhROqNQ7rTxFJOXtrOU9O1AEOAzQL235FgX/+ QIX09ObR25qqUTFCgpHhzhNknTgg+8xM9BiiTgahfTV5kkp2iNo0yf3LqbBUeOKTa1kX /6ilV6sC3lwVLBcmDKcT9IBw5L9CsQL6XXOyb2IDVmYCzkobB/SKokcYubfiaG1mOdOP oD1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=og4WZce3; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wv4-20020a170907080400b007c0b52d0df1si7423052ejb.660.2023.01.08.08.44.36; Sun, 08 Jan 2023 08:44:59 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=og4WZce3; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233542AbjAHQau (ORCPT + 99 others); Sun, 8 Jan 2023 11:30:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236195AbjAHQag (ORCPT ); Sun, 8 Jan 2023 11:30:36 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57075D10B for ; Sun, 8 Jan 2023 08:30:36 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E7BF260CA4 for ; Sun, 8 Jan 2023 16:30:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 43BDDC433EF for ; Sun, 8 Jan 2023 16:30:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673195435; bh=u9DYwf7CA8XuMgYmvtC4bPAvv6xzFBFcq7dZkbMKh+Y=; h=Subject:From:To:Date:In-Reply-To:References:From; b=og4WZce32B3pOD24Vc6X5cl41sw90C8EA1dM9rXq4jXKVmmAiTo7fwtE6zfELc3q4 o2OfxEzvWBDWkxWx4UYPy0TQ1UAgeyO5IHd1PeF8YKj6Ilf/hp+UJ9E9rO4euOdNr/ TwOs/gKKX+fXptFHMP5RYnj98/IbaMFZi7+qO9sDUDWOuxY/HgU8baHP+TkP1f68s9 wUvqwn3wrBuGnqv7MdllQ65fOgzkpMIg4qKh7YHHZHSTdA9nf514dQyflaq+J4p0Z7 NHco4eoNixDyRR0UALugbf/I0SPC7e5rPEK5JKP94y/1J0fc50tHrM59cAjIfqUzen VWa+H1aHC4uyw== Subject: [PATCH v1 21/27] SUNRPC: Hoist init_encode out of svc_authenticate() From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Sun, 08 Jan 2023 11:30:34 -0500 Message-ID: <167319543438.7490.15983256373144808077.stgit@bazille.1015granger.net> In-Reply-To: <167319499150.7490.2294168831574653380.stgit@bazille.1015granger.net> References: <167319499150.7490.2294168831574653380.stgit@bazille.1015granger.net> 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=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 From: Chuck Lever Now that each ->accept method has been converted, the svcxdr_init_encode() calls can be hoisted back up into the generic RPC server code. Signed-off-by: Chuck Lever --- net/sunrpc/auth_gss/svcauth_gss.c | 2 -- net/sunrpc/svc.c | 2 ++ net/sunrpc/svcauth_unix.c | 3 --- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c index 89333669af26..560fb8a2803d 100644 --- a/net/sunrpc/auth_gss/svcauth_gss.c +++ b/net/sunrpc/auth_gss/svcauth_gss.c @@ -1589,8 +1589,6 @@ svcauth_gss_accept(struct svc_rqst *rqstp) int ret; struct sunrpc_net *sn = net_generic(SVC_NET(rqstp), sunrpc_net_id); - svcxdr_init_encode(rqstp); - rqstp->rq_auth_stat = rpc_autherr_badcred; if (!svcdata) svcdata = kmalloc(sizeof(*svcdata), GFP_KERNEL); diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index 9951311790bf..393eebd1f6fe 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c @@ -1262,6 +1262,8 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *resv) if (rqstp->rq_prog == progp->pg_prog) break; + svcxdr_init_encode(rqstp); + /* * Decode auth data, and add verifier to reply buffer. * We do this before anything else in order to get a decent diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c index 632150a6b947..b101700d155c 100644 --- a/net/sunrpc/svcauth_unix.c +++ b/net/sunrpc/svcauth_unix.c @@ -772,7 +772,6 @@ svcauth_null_accept(struct svc_rqst *rqstp) if (cred->cr_group_info == NULL) return SVC_CLOSE; /* kmalloc failure - client must retry */ - svcxdr_init_encode(rqstp); if (xdr_stream_encode_opaque_auth(&rqstp->rq_res_stream, RPC_AUTH_NULL, NULL, 0) < 0) return SVC_CLOSE; @@ -855,7 +854,6 @@ svcauth_tls_accept(struct svc_rqst *rqstp) if (cred->cr_group_info == NULL) return SVC_CLOSE; - svcxdr_init_encode(rqstp); if (rqstp->rq_xprt->xpt_ops->xpo_start_tls) { p = xdr_reserve_space(&rqstp->rq_res_stream, XDR_UNIT * 2 + 8); if (!p) @@ -959,7 +957,6 @@ svcauth_unix_accept(struct svc_rqst *rqstp) return SVC_DENIED; } - svcxdr_init_encode(rqstp); if (xdr_stream_encode_opaque_auth(&rqstp->rq_res_stream, RPC_AUTH_NULL, NULL, 0) < 0) return SVC_CLOSE;