From patchwork Wed Jan 3 08:41:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13509723 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 2C1E4C3DA6E for ; Wed, 3 Jan 2024 08:42:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B974E6B0300; Wed, 3 Jan 2024 03:42:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B46416B0301; Wed, 3 Jan 2024 03:42:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A363E8D0035; Wed, 3 Jan 2024 03:42:08 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 925B56B0300 for ; Wed, 3 Jan 2024 03:42:08 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 689D940335 for ; Wed, 3 Jan 2024 08:42:08 +0000 (UTC) X-FDA: 81637357536.06.C2088BC Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf08.hostedemail.com (Postfix) with ESMTP id C0308160010 for ; Wed, 3 Jan 2024 08:42:06 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=29MO4YRf; spf=none (imf08.hostedemail.com: domain of BATV+f852f126c6d693376302+7437+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+f852f126c6d693376302+7437+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1704271326; 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=JyTeuU47XuQs/S1QReYYzbLy/yqaC4/phAnhRBZRZ6E=; b=mHHgBllAbxaLoeokvVgtT5upMNErjHjwYYpMJo8Gs3nm+vMilZGrkQL/9vFqlq/tWJa+5c c/W/2CjNwN0ZgXnAuV9TkHR/dhTA8WrXNEqoLxkabVvuX/E4V9rxbkX6JQyF1pvhIbjigA dU6C7ogwYexdFu3PvwrYloxRsVBt/TM= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=29MO4YRf; spf=none (imf08.hostedemail.com: domain of BATV+f852f126c6d693376302+7437+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+f852f126c6d693376302+7437+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1704271326; a=rsa-sha256; cv=none; b=vCR8VPvzaZBxvBoedmTe1GJTPfU5pj8CfL60ljuw5RGoo/Dzbt5ADarBDG02Tw8VBPtStI ld91aXdW2gpq01HFHXsSEaUGapPoZB6cR4Pq+y5qwAoGKeJYmz/33xLVufrVPN3a60tHXe szFyDE8c3ZHtlCaTt+r/unkLr7zUTcE= 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=JyTeuU47XuQs/S1QReYYzbLy/yqaC4/phAnhRBZRZ6E=; b=29MO4YRfLExY/z1gx34n+St5Br wJZHtdNQtl7aItiOb0oXEIRfoH77oZEj6VqZCdqTihnqysV86tOwebaFr4XtebXskmXpABjpN5iHg FTkxaiBPVS3V0RTS9P62FJ0a8mRD01IcBfTKTeSnIQ8VQJukz3PObvmp8irOlj05rOIaMBdbdZN96 AT3mXCLOqZI5bA3JbFwLfQyabOUueuB0rkBXaFVYeJXVYMdshaOVXLOhK1hS4mACw9NSXR2I+KzSo ZYDLD6apY6ZRNWfjHxq/hBJp2mzMncRy9GPLUE2XPE6GVUffy+N/HxSFGIBXD/AslTzka8xOS9dBE OmeEuniA==; Received: from [89.144.222.185] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1rKwp6-00A6gR-2s; Wed, 03 Jan 2024 08:42:01 +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 06/15] xfs: don't try to handle non-update pages in xfile_obj_load Date: Wed, 3 Jan 2024 08:41:17 +0000 Message-Id: <20240103084126.513354-7-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240103084126.513354-1-hch@lst.de> References: <20240103084126.513354-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-Queue-Id: C0308160010 X-Rspam-User: X-Stat-Signature: fp9pu9xu1b58i54p81dys66zi3z37dod X-Rspamd-Server: rspam01 X-HE-Tag: 1704271326-326285 X-HE-Meta: U2FsdGVkX1+MBbxwtZFfNx0jRJa3/qSWUFpiFRSLViGx1adoLVi728t3NJSBqe5DW1lMw0l1NzSp3hbDyH3NS8mRN6z4UYinHuBjMEBp05QU3mIZWol3oWDZ4CWmV4NkINPJfyMcipUqVq4yTo7toXUYnhK47Cg03EB3yQXhGrSmK0F4FPfvpzqd7uva1+AiDLR2Bex1fFkJ2gL8u2vtBR2gRdkUtT6kTGhQA6487k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yhMpfbgNsL2AzjRYk9DjGXS0UcKZ9BDYneb1HpFA4DoE+BENHF8eSEWZczYy9seUxltpwSQMjSDFgSWR4lRr8a1MEovOrFoTrMZrymxaLs7WzgHmc2g== 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 9e25ecf3dc2fec..46f4a06029cd4b 100644 --- a/fs/xfs/scrub/xfile.c +++ b/fs/xfs/scrub/xfile.c @@ -166,18 +166,14 @@ xfile_obj_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: