Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp100383iof; Sun, 5 Jun 2022 22:22:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyOpx8S8OFt/JDQNKv3U8zUy+raU4Q0aRLQwjz1Tx4t4+RjtyNpV6mrP5vyANyaDs7RvIF X-Received: by 2002:a17:90b:1d08:b0:1e3:2a4f:6935 with SMTP id on8-20020a17090b1d0800b001e32a4f6935mr37353541pjb.174.1654492962544; Sun, 05 Jun 2022 22:22:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654492962; cv=none; d=google.com; s=arc-20160816; b=AWqNcg8sIT0IAJXMFEp/BsqHPBJs1CnBauh1Yv8Z8zfi4j4WEIOYFM6PlxGjc13kZt GfJD3Q6p6/0h0MiQLzaxCBk53zOJjZJ+1kSyWct9YvNg9JDUF+GrGm7ZW9L3ff2yapZ6 J6V/Gxb3Pkc0bHEu7MUZVQom6aUwQqgkFWGIPz9yyPRzudlZINdCcDGk6ZZXyl1S3RrD 9i4YyzQvnnzCIh99hC8QYASJoT6CQ5waiTA/irhKT1l8CdNSIPrJwofIydWPVQYps3Tj dzxYyGWGj9PTQcxiun5TFW/yZfxnUKu/vuk9Vxv7QEB5XsAXW3IVxqmY3kdT48QViv3Z cIsw== 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:message-id:date:to:from:subject; bh=RpqsJaq4XTY1earIqJhXKyKT2KZ5pFYO88Qte8WfhCM=; b=LqavpwG/cbnQ6bZ3A1JRM0w2bbT2R2SEVnmz5RJuxD+7NS0Z8q0I6oGXLPocWvMDgw twV0fIxl8DMmjkO2SytNVo8hzcuSS0G07tZaVc2lQ8Z/4qVI/8kEKrS6w3Q7gHrckaFb lgRpi4dhSw2XRP7Zu9LeQAAq9v96yksOrwNdnAsQvAFdsfcuNINPLM+9NSiA2LcPM4fl vUUsDUkMzj4oTliIGmRNJrnqOqWkIB+Hv+FwkXaGMhE3eUYapRjxYXW1QaINPA2nBZry nbp8/sZQbTwc+1lYq8dXAoPU1m4inSV9zSQ/rFFxEguzfSBT0pCuI7cJTSxKHEpYbGFc bNfg== 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:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id mq18-20020a17090b381200b001d99fab8c25si21483677pjb.10.2022.06.05.22.22.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 22:22:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EEE1D196AB5; Sun, 5 Jun 2022 21:25:16 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344175AbiFET6X (ORCPT + 99 others); Sun, 5 Jun 2022 15:58:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343714AbiFET6W (ORCPT ); Sun, 5 Jun 2022 15:58:22 -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 7C14A49687 for ; Sun, 5 Jun 2022 12:58:21 -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 09A8F6118D for ; Sun, 5 Jun 2022 19:58:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 56706C385A5 for ; Sun, 5 Jun 2022 19:58:20 +0000 (UTC) Subject: [PATCH v1 0/5] Fix NFSv3 READDIRPLUS failures From: Chuck Lever To: linux-nfs@vger.kernel.org Date: Sun, 05 Jun 2022 15:58:19 -0400 Message-ID: <165445865736.1664.4497130284832282034.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=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 While looking into the filecache CPU soft lock-up issue, I ran across this problem. I thought I could run it down in just an afternoon (I was wrong) and that this problem probably affects more users than the soft lock-up (jury's still out). Anyway, NFSD's new READDIRPLUS dirent encoder blows past the end of the directory payload xdr_stream when the client requests more than a page worth of directory entries. I tracked this down to how xdr_get_next_encode_buffer() computes xdr->end. First patch in this series is the fix. The remaining patches are clean-ups and optimizations. I want to get this into 5.19-rc quickly. I would appreciate getting at least two R-b's for this series. --- Chuck Lever (5): SUNRPC: Fix the calculation of xdr->end in xdr_get_next_encode_buffer() SUNRPC: Optimize xdr_reserve_space() SUNRPC: Clean up xdr_commit_encode() SUNRPC: Clean up xdr_get_next_encode_buffer() SUNRPC: Remove pointer type casts from xdr_get_next_encode_buffer() net/sunrpc/xdr.c | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) -- Chuck Lever