Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp2469478rwe; Sun, 28 Aug 2022 12:22:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR4ks21gmcnUp1cEf4O57LmMok8oe/z19adL+oU8eKyI3Y03yG2b8v7zhthUKQrN76SbaELP X-Received: by 2002:a17:90b:1d83:b0:1fb:6795:5cc9 with SMTP id pf3-20020a17090b1d8300b001fb67955cc9mr15169221pjb.162.1661714567020; Sun, 28 Aug 2022 12:22:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661714567; cv=none; d=google.com; s=arc-20160816; b=kt7DNu9FgB3NfYPC+Jx4W852oOssKWq022I4V1NM8hqbw7zudk4jyjnby0i44I27QC Hee/Fo8lz6l0abfOB/sgo8nCa09Cle9TI+wiIqyR4H4IDeMl31cXiy1qsAjyqjMMfT7n yvkzuEULdNCWXGwQKi9jbwkg4x/X5euSWULDGztHPSvrOfdTtBs20yOr56yHIQd5nG2M 9iHgBq/uY2OCA2pizZ5qVxMsY+4VjnrVjHwg1Xmdti4KrLXIrq+F/+ehDlGc0f73A7Gl 20szzSfqqIFfx+JVeqIwj7GLMQqJ/4hiRkYRHw1Z/UZRmOy9sk+t4SMHgM42lFBeOoQ+ mHBA== 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; bh=lo+/sC+2Cg1jg2ALcAho9pF7sgCKR1URSq/PQdWeYJw=; b=JFUUHhFTnx1fRab0J5euSG9/1owEOwNYBh7FTMZx3eeD2T6m1D9AtYdELq2x02OQhC iEFktgbjkoCYU4UQ6sp1zEuzDOvD4cdM1yU6joTBZ2VK3B7VUzURTJ9VUiICWSNnlVrC FGLa/GPRyLhuMAm0QJ2RpIY33vp3Y0yxbDZUMNKqolXRXLAGX0wdGMf0eUYmXJ4XOmPd 8U51nnvfyuxaop0a2gwk8YGX6t9JUXkkeh7IIGjTOjrgadWdnVOGyOtspTssAE4lrSk+ 6GVtnNR6wSWPMWrUKUWVmn6mkNLRFLKakSIvbUvmzOIE+gQ5cr4aOwxbSqRQBvpm3GR+ tz0w== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s194-20020a632ccb000000b0042b96dfc026si4541487pgs.15.2022.08.28.12.22.34; Sun, 28 Aug 2022 12:22:47 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229547AbiH1SvD (ORCPT + 99 others); Sun, 28 Aug 2022 14:51:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229939AbiH1SvD (ORCPT ); Sun, 28 Aug 2022 14:51:03 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59F0D101CE for ; Sun, 28 Aug 2022 11:51:02 -0700 (PDT) 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 E553360DED for ; Sun, 28 Aug 2022 18:51:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3169CC433D6; Sun, 28 Aug 2022 18:51:01 +0000 (UTC) Subject: [PATCH v2 7/7] NFSD: Clean up nfs4svc_encode_compoundres() From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Sun, 28 Aug 2022 14:51:00 -0400 Message-ID: <166171266025.21449.2692376100575745686.stgit@manet.1015granger.net> In-Reply-To: <166171174172.21449.5036120183381273656.stgit@manet.1015granger.net> References: <166171174172.21449.5036120183381273656.stgit@manet.1015granger.net> User-Agent: StGit/1.5.dev2+g9ce680a5 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 In today's Linux NFS server implementation, the NFS dispatcher initializes each XDR result stream, and the NFSv4 .pc_func and .pc_encode methods all use xdr_stream-based encoding. This keeps rq_res.len automatically updated. There is no longer a need for the WARN_ON_ONCE() check in nfs4svc_encode_compoundres(). Signed-off-by: Chuck Lever --- fs/nfsd/nfs4xdr.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 1e9690a061ec..af51e2a8ceb7 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -5423,12 +5423,8 @@ bool nfs4svc_encode_compoundres(struct svc_rqst *rqstp, struct xdr_stream *xdr) { struct nfsd4_compoundres *resp = rqstp->rq_resp; - struct xdr_buf *buf = xdr->buf; __be32 *p; - WARN_ON_ONCE(buf->len != buf->head[0].iov_len + buf->page_len + - buf->tail[0].iov_len); - /* * Send buffer space for the following items is reserved * at the top of nfsd4_proc_compound().