From patchwork Fri Jan 26 13:28:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13532573 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 8EED4C47DDF for ; Fri, 26 Jan 2024 13:30:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 204E26B0078; Fri, 26 Jan 2024 08:30:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 18E826B007B; Fri, 26 Jan 2024 08:30:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 07D166B0080; Fri, 26 Jan 2024 08:30:03 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id EBF106B0078 for ; Fri, 26 Jan 2024 08:30:02 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id C0F5C1C0D9F for ; Fri, 26 Jan 2024 13:30:02 +0000 (UTC) X-FDA: 81721545444.12.1D0267A Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf08.hostedemail.com (Postfix) with ESMTP id 03A0016000D for ; Fri, 26 Jan 2024 13:30:00 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=1ChCLOer; dmarc=none; spf=none (imf08.hostedemail.com: domain of BATV+8230b42af99c397292d7+7460+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+8230b42af99c397292d7+7460+infradead.org+hch@bombadil.srs.infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706275801; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=5C9VP1SaExA9uyPFl5WPVHE4cTMuqE1mtuEvKQxBCh0=; b=5rccxba6ISsmmEy6mkWgCaJU6VU/AELS1B8iznVnNTxjjAxo+VYGrB5haoxeSkb1mKYHrE /NlH6yE1lc7axOQ7nnyh3+xf2/eQNsLMFQGBFxollnFVM6zj/tCOFEw5s4j69YlMeIzwOQ 7JkKAU57e8hnHclKWhwLpsMUQMfoaf0= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=1ChCLOer; dmarc=none; spf=none (imf08.hostedemail.com: domain of BATV+8230b42af99c397292d7+7460+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+8230b42af99c397292d7+7460+infradead.org+hch@bombadil.srs.infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706275801; a=rsa-sha256; cv=none; b=Nc9lGncFdpSKGyaaP6uWaQDL3l17dDkEQFHSVDtfOExzEugICvvlfSKn7pQy95e41SId66 xkTYobOyhYOo0BmyKVk67uwDVvTmEc2T/s/bi25nzB90plXv1Ric3eb2wEOkaJWPaIGyzq eZMhNswyTxjlIE83897crDOcvY61eRo= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=5C9VP1SaExA9uyPFl5WPVHE4cTMuqE1mtuEvKQxBCh0=; b=1ChCLOeroR7dQqYdR5AXNYr1Z4 o8nXFMvA03KaWJYAdTLzKQAjFQDtTJLAjUJym+hifoq1BU+ewTsTqMjsM4rvfMrJTXpNkLkQYpxJ7 C5P4H4B225jgIsjOBoQFolOqzPJROg4/qHYpxzifySOP+wpW+l8Lfm5PuR5tOyzesgr0Hk/csyvdG QY5oL1xAe2TGkD8Bm2Et80Pk/tVUVr8ItZjBFJ4qRn6rBKAaaKOyPfZUem51N2STdSXZu2diYvpms NZe32dI0JGZE2SLOiKv8/E4ubitwNdnBLAWJj+w1AOCtlTp3xPqcPKHiVItw5cuXYbd5V26NqnvCk LZAXUuYQ==; Received: from 2a02-8389-2341-5b80-39d3-4735-9a3c-88d8.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:39d3:4735:9a3c:88d8] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1rTMH8-00000004Clz-2KQP; Fri, 26 Jan 2024 13:29:45 +0000 From: Christoph Hellwig To: Chandan Babu R , "Darrick J. Wong" , Hugh Dickins , Andrew Morton Cc: linux-xfs@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 10/21] xfs: don't try to handle non-update pages in xfile_obj_load Date: Fri, 26 Jan 2024 14:28:52 +0100 Message-Id: <20240126132903.2700077-11-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240126132903.2700077-1-hch@lst.de> References: <20240126132903.2700077-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 03A0016000D X-Stat-Signature: wpaqm45dnwp6wnqp85zdghyc7fa1xsca X-Rspam-User: X-HE-Tag: 1706275800-610035 X-HE-Meta: U2FsdGVkX1+cN9ZiiMFRae4fg6DICEtTgNRu89LZby9dyfzbOuRHeI0Rr1ypvF8UWRID+jLbpoUcBrCzEZ3M/XTJ+w7M5bPJTcUcAU4SCPUJ14S2gPrM9F+WHpgs+TQV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uKqvZYr4XLghZS3ZC2rPsNSu+fpmbtGwHvg6I2r+IAPPhKJqoddLwwoVLF+sNvuCiFnQCh0dY9qMjPgfGzuK+vYcLMKd/eRQERlTl6eA1A18oD+2xhN88NgC26dhXYUAyds4vEMeWHdGXDD2PmZVZZgbIoOqJO14rSIt5Co7nt5unXSlgiizSYC69qTbA2nOl3HBS0+Iic1tGx+a04uNmnAdIuxzJtpiXlRHjm4Ryz+BgIlLp3FbJkt/9lDfan4WDZK1CO105iFt66FPkThVYxscnvwjwsgEoATT6S2lUwBFUjEBkIKJNICHF4D4u/DaOWjIZ8IFllDMAdE2P3oUXTf/Q= 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: List-Subscribe: List-Unsubscribe: shmem_read_mapping_page_gfp always returns an uptodate page or an ERR_PTR. Remove the code that tries to handle a non-uptodate page. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong --- fs/xfs/scrub/xfile.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/fs/xfs/scrub/xfile.c b/fs/xfs/scrub/xfile.c index d65681372a7458..71c4102f3305fe 100644 --- a/fs/xfs/scrub/xfile.c +++ b/fs/xfs/scrub/xfile.c @@ -166,18 +166,14 @@ xfile_load( goto advance; } - if (PageUptodate(page)) { - /* - * xfile pages must never be mapped into userspace, so - * we skip the dcache flush. - */ - kaddr = kmap_local_page(page); - p = kaddr + offset_in_page(pos); - memcpy(buf, p, len); - kunmap_local(kaddr); - } else { - memset(buf, 0, len); - } + /* + * xfile pages must never be mapped into userspace, so + * we skip the dcache flush. + */ + kaddr = kmap_local_page(page); + p = kaddr + offset_in_page(pos); + memcpy(buf, p, len); + kunmap_local(kaddr); put_page(page); advance: