From patchwork Tue Apr 12 18:57:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever III X-Patchwork-Id: 12811125 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3DABC433EF for ; Tue, 12 Apr 2022 18:57:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1121B6B0072; Tue, 12 Apr 2022 14:57:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0C2B06B0073; Tue, 12 Apr 2022 14:57:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ECC566B0074; Tue, 12 Apr 2022 14:57:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.28]) by kanga.kvack.org (Postfix) with ESMTP id D955B6B0072 for ; Tue, 12 Apr 2022 14:57:39 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id A207924CF5 for ; Tue, 12 Apr 2022 18:57:39 +0000 (UTC) X-FDA: 79349135838.02.E273C28 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf09.hostedemail.com (Postfix) with ESMTP id 147A0140004 for ; Tue, 12 Apr 2022 18:57:38 +0000 (UTC) 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 343BC619B6 for ; Tue, 12 Apr 2022 18:57:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 67B7FC385A5; Tue, 12 Apr 2022 18:57:37 +0000 (UTC) Subject: [PATCH v1] NFSD: Clean up nfsd_splice_actor() From: Chuck Lever To: linux-nfs@vger.kernel.org Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Date: Tue, 12 Apr 2022 14:57:36 -0400 Message-ID: <164978985638.4322.14481417646650679676.stgit@bazille.1015granger.net> User-Agent: StGit/1.5 MIME-Version: 1.0 X-Stat-Signature: f7bsnwode7dfjo5ets9n4eewt31ewe3j X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 147A0140004 Authentication-Results: imf09.hostedemail.com; dkim=none; spf=pass (imf09.hostedemail.com: domain of "SRS0=tTYD=UW=oracle.com=chuck.lever@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=tTYD=UW=oracle.com=chuck.lever@kernel.org"; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=oracle.com (policy=none) X-Rspam-User: X-HE-Tag: 1649789858-811999 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: nfsd_splice_actor() checks that the page being spliced does not match the previous element in the svc_rqst::rq_pages array. We believe this is to prevent a double put_page() in cases where the READ payload is partially contained in the xdr_buf's head buffer. However, the NFSD READ proc functions no longer place any part of the READ payload in the head buffer, in order to properly support NFS/RDMA READ with Write chunks. Therefore, simplify the logic in nfsd_splice_actor() to remove this unnecessary check. Signed-off-by: Chuck Lever --- fs/nfsd/vfs.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index c22ad0532e8e..4c1984f07cdc 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -849,17 +849,11 @@ nfsd_splice_actor(struct pipe_inode_info *pipe, struct pipe_buffer *buf, struct splice_desc *sd) { struct svc_rqst *rqstp = sd->u.data; - struct page **pp = rqstp->rq_next_page; - struct page *page = buf->page; - if (rqstp->rq_res.page_len == 0) { - svc_rqst_replace_page(rqstp, page); + svc_rqst_replace_page(rqstp, buf->page); + if (rqstp->rq_res.page_len == 0) rqstp->rq_res.page_base = buf->offset; - } else if (page != pp[-1]) { - svc_rqst_replace_page(rqstp, page); - } rqstp->rq_res.page_len += sd->len; - return sd->len; }