Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp5783951rwn; Mon, 12 Sep 2022 14:25:16 -0700 (PDT) X-Google-Smtp-Source: AA6agR41XecjQKRXHR9mCUZSlChUGWGP3XXlgf9Ieda/PT3m6V4QXGjS3RxCpDqy1okP28yYFn/e X-Received: by 2002:a17:90b:3a87:b0:202:d8b7:2c03 with SMTP id om7-20020a17090b3a8700b00202d8b72c03mr344716pjb.199.1663017916353; Mon, 12 Sep 2022 14:25:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663017916; cv=none; d=google.com; s=arc-20160816; b=EuNTelQeRy//DHKKr3FyJOMh4oYvksA9W9cdP7AMuD/xLoTIQQB6HaV7DcFa6kxLPv MSTpPv0BJUBAaSEeCYdpLtCA4+Y1F4IRGmGFmnVDNovgdonYSsQQjpUYcnmiW/7deWnD 2KM0st//eSaDw1P6rD0CKWR963dGAetsU7S6kl+/Bej8NGMt40vK94c4rXRjUnS748+2 6DYey1lo4ksChZ8NYQ+4UwnWx0fj8shfWlmLZKHLbp9vcvRxSieiU5ZFIh0F6lzcEMvR xl6/PSuiZ49oEPYqHTi7ybXZzYpzP2dl/w6VW4xDITLu/LfsCbANdXMgQHnjMJ/lhItQ ezDw== 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=AiFLvvSTCGIMwWCEUh1idByZ/Yn3iZp3m3p9DGx/GJU=; b=ZP0yvxzyGmFVCxfRpT7IF5oVvQhyKh2tmwCFz/4MmXY3S8Ok/TQWCXUovYfJa5grBv G9k37G68f/S0EBbhOkk5zjhyU7VjBGXHEDSDm92+3+eR7snGMafyuANegU+Kh9UR3vf4 eYf3ilVyt5RUucegOlHd229QDK3BT57QHstV0KNzdvcmd3O1cqnqH3DSskFZek5AtXyI ZQ5ZHKXs46c6Z2QHRkk63c4MPE6B94WhPbweyuR6k4IJwV3zWDVJt3DMQLtBPzbimite r7BKXS48LXk+beMAuJPg1Y5IJtTeSsR/NDrQUQHAa/DN5tjY/UA3vyEIo80/SfbZVlox 03YA== 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 a5-20020a630b45000000b0042890f36268si10032989pgl.857.2022.09.12.14.25.03; Mon, 12 Sep 2022 14:25:16 -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 S229629AbiILVXY (ORCPT + 99 others); Mon, 12 Sep 2022 17:23:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229698AbiILVXX (ORCPT ); Mon, 12 Sep 2022 17:23:23 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A48242AC65 for ; Mon, 12 Sep 2022 14:23:22 -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 ams.source.kernel.org (Postfix) with ESMTPS id 5E5BEB80C9E for ; Mon, 12 Sep 2022 21:23:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25987C433D6 for ; Mon, 12 Sep 2022 21:23:20 +0000 (UTC) Subject: [PATCH v1 09/12] NFSD: Clean up nfs4svc_encode_compoundres() From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Mon, 12 Sep 2022 17:23:19 -0400 Message-ID: <166301779933.89884.4528707315025844737.stgit@oracle-102.nfsv4.dev> In-Reply-To: <166301759113.89884.7985359396842428444.stgit@oracle-102.nfsv4.dev> References: <166301759113.89884.7985359396842428444.stgit@oracle-102.nfsv4.dev> 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=-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(). Reviewed-by: Jeff Layton 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 49afc0e5b04c..88ced20fec11 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -5459,12 +5459,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().