Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1047180rwe; Thu, 1 Sep 2022 11:34:37 -0700 (PDT) X-Google-Smtp-Source: AA6agR4pSRPbnZtKWvh/NpswLdZrXkIEvgS//jHG/kO7GJHmSO1f5rrpayQ3DJyIqnMTTizhyAcM X-Received: by 2002:a62:ea14:0:b0:535:c678:8106 with SMTP id t20-20020a62ea14000000b00535c6788106mr32825426pfh.9.1662057276866; Thu, 01 Sep 2022 11:34:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662057276; cv=none; d=google.com; s=arc-20160816; b=ZE+/RUHdRDLqjOYtnWBLAagB8DcRPiF+uPUaDSWkNdEdTl1JCyozIdKuiEHLl8dwgs 6W++E5xBAURvbxB2iTTXkg8nTDE8C0ObzgR6/zjss/GLEypkWAtXHBJ2jJU/nglQnexf 5SLQ1Pmhxlsp4XU1d8XADkW/37qdx9N940WajuDdWY1bO7+bW/Nf7aLkhinwSWwp4KZO 9Nalj6aKFMsiEHCcD0INdlVQV+dBGWqOL82Cr+NlU/BmDIqojEbOpxPtpfqIiQ9TX3yq vRbqUyTrXWXFO3c2AQ0AFvEVJOtzP/4vYjuC9X0nKn9FYE1N2wKiu1MFQD4tGnKdfZCe IaIQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=30SHxjD9mCr2ImEtRCmHS+D6quEmHnZClf285slEDWU=; b=iszFx+YgMDEyeqAmyBM3Qsys1wACc3AqmiV/rGX2Gyj7lLzyBIsS2H1DlyCXkdIDMn N/94hBNGKJfMccFZ82sR5Dx8XXsanKj7QX1hGnwXDkkrZ1g92nwpJcyTV5B6qu6+usR3 0E5YuNbmBP8D2XC2GSCUEv0ZSmYY+IRYukESZy5yOIadoKY5ZiwvW6DysMuGb0OkxBVj IQoSX2tUb8AjviWafZO5cWdqLhyPAfE9LBF6edQwJn3HbEspVgWgGNBWiVxUVyQokoHO /sZvXsVSCuECPbKcoqD5iuy8FSHVSrzvok/pvco8zl3aLAFj3inA3paHVO1t/7IrS67U +NCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EeRjhs9F; 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 z9-20020a170903018900b0017542c161d7si6369680plg.211.2022.09.01.11.34.22; Thu, 01 Sep 2022 11:34:36 -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=@kernel.org header.s=k20201202 header.b=EeRjhs9F; 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 S232641AbiIASdr (ORCPT + 99 others); Thu, 1 Sep 2022 14:33:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233483AbiIASdq (ORCPT ); Thu, 1 Sep 2022 14:33:46 -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 A594E7E03E for ; Thu, 1 Sep 2022 11:33:45 -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 5E2B9B81BDF for ; Thu, 1 Sep 2022 18:33:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C9AE3C433D6; Thu, 1 Sep 2022 18:33:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662057223; bh=i62gzEvAtL5qBJpUXgIhWpR6R0f2mKcaU3mjEPTnT8c=; h=From:To:Cc:Subject:Date:From; b=EeRjhs9FJ0ez+xt7VnapDeIy8BydGK74nwzAZMmH52oU14OX6MRP848tep9xeCGmD VZQ4VJT8fSkl7D1jDKHBQY0KnFbipJbNE1MgCqgOT3JIfeIsiMqCj22NHVUyC+aytc OkdVydR+ARQO5lGRO/cdDxaozKfDQu1AjG5yj4ONEcJcH3kH7NSIJKt6UxZzCIeD1S khkJJKYlecSnKcgHhSG8JU/XaR5uayN1k5H+1rZK2a3Uoj1a39gqBOGmYGbNDD7qCq yHTDPhUtE6pEY/pwcu0fLAwpgT5mDYNiaFYusYExubWDeEzMPVdUDY12ToswsdjbEb wZX8oqI7BibOg== From: Anna Schumaker To: linux-nfs@vger.kernel.org, chuck.lever@oracle.com Cc: anna@kernel.org Subject: [PATCH 0/1] NFSD: Simplify READ_PLUS Date: Thu, 1 Sep 2022 14:33:40 -0400 Message-Id: <20220901183341.1543827-1-anna@kernel.org> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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,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 From: Anna Schumaker When we left off with READ_PLUS, Chuck had suggested reverting the server to reply with a single NFS4_CONTENT_DATA segment essentially mimicing how the READ operation behaves. Then, a future sparse read function can be added and the server modified to support it without needing to rip out the old READ_PLUS code at the same time. This patch takes that first step. I was even able to re-use the nfsd4_encode_readv() function to remove some duplicate code. Chuck, I tried to add in sparse read support by adding this extra change. Unfortunately it leads to a bunch of new failing xfstests. Do you have any thoughts about what might be going on? Is the patch okay without the splice support? diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index adbff7737c14..e21e6cfd1c6d 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -4733,6 +4733,7 @@ static __be32 nfsd4_encode_read_plus_data(struct nfsd4_compoundres *resp, struct nfsd4_read *read) { + bool splice_ok = test_bit(RQ_SPLICE_OK, &resp->rqstp->rq_flags); unsigned long maxcount; struct xdr_stream *xdr = resp->xdr; struct file *file = read->rd_nf->nf_file; @@ -4747,7 +4748,10 @@ nfsd4_encode_read_plus_data(struct nfsd4_compoundres *resp, maxcount = min_t(unsigned long, read->rd_length, (xdr->buf->buflen - xdr->buf->len)); - nfserr = nfsd4_encode_readv(resp, read, file, maxcount); + if (file->f_op->splice_read && splice_ok) + nfserr = nfsd4_encode_splice_read(resp, read, file, maxcount); + else + nfserr = nfsd4_encode_readv(resp, read, file, maxcount) if (nfserr) return nfserr; Thanks, Anna Anna Schumaker (1): NFSD: Simplify READ_PLUS fs/nfsd/nfs4xdr.c | 122 ++++++++-------------------------------------- 1 file changed, 20 insertions(+), 102 deletions(-) -- 2.37.2