From patchwork Mon Feb 19 06:27:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13562216 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 03E7BC48BC3 for ; Mon, 19 Feb 2024 06:28:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 225C28D0012; Mon, 19 Feb 2024 01:28:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1B09A8D0007; Mon, 19 Feb 2024 01:28:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EF6D68D0012; Mon, 19 Feb 2024 01:28:04 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id CEE578D0007 for ; Mon, 19 Feb 2024 01:28:04 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id A83FB120244 for ; Mon, 19 Feb 2024 06:28:04 +0000 (UTC) X-FDA: 81807573288.21.35D00A1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf22.hostedemail.com (Postfix) with ESMTP id 1838FC000D for ; Mon, 19 Feb 2024 06:28:02 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=XdjKpLfK; spf=none (imf22.hostedemail.com: domain of BATV+994827af29a55d2021e7+7484+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+994827af29a55d2021e7+7484+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708324083; a=rsa-sha256; cv=none; b=BWEzHNwiKk0gtGOtXkUCjSLQ8kx6ldZmmGhsTYYHhERIiZIQfdmmlLLOa5Ta6GGnBZIfQB 4IywhONH7idGBRXAFmooF9kdpnIy/aF+YCZaqnIPlFwpanylIc9QSHm3rTN7tFK2N9Jo6Y jerB3sBJ4uhLt+i/cXQuhnjluX3W8Yk= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=XdjKpLfK; spf=none (imf22.hostedemail.com: domain of BATV+994827af29a55d2021e7+7484+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+994827af29a55d2021e7+7484+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=1708324083; 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=F7Vyl1D3QQTGAjflgR6G3n7BYbKCD0s/3rfb9BjRAcU=; b=8cYKclwngbx3hUTlmRVssbHHCQnaGSJka27T+TJGrj7Vc9GkdANHmA4leM5GbLDREFZV9W lxP/l3jC3bQ5PVN2EOlb/2ZBBAbObYGQBLEi1QynDOvNUVxQQsEEQBkFwrLSBlv/zviZ7N In8xfcKuLzSMm4XxXcqkcyWEGub/4Ls= 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=F7Vyl1D3QQTGAjflgR6G3n7BYbKCD0s/3rfb9BjRAcU=; b=XdjKpLfKFuJN2lTHOZIm9KlT6v QYEa7VCt9CBmlb5HYKCkB2uV7sM8fUy+SnkgVIAukNQEAIh2GtAcVVA4w5rYRepnGwY+CRPFoPswx Ku/8skOkzKDp3banGGM5S9ey6r8xva9uxEwxt30NlzjHa+ASNa01UJN5ck3z6XcgNVMD0lt9XFUcA K+6D62p8TN4G9BIO9uQt8y/n7SKx7Q606hvWTKHwwhaAO3Us6oJ8UQyKL+HK3QZfK/6drhsb9ryRa PF1ur9Fggmog+eFByc8PuglAwKW6WNSW9n5l/uIDIt9k9Dy+rijoTGS5X0eFruF6fhK7BeW9vtM2N snmxUPOw==; 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 1rbx8B-00000009FIN-0N6X; Mon, 19 Feb 2024 06:27:59 +0000 From: Christoph Hellwig To: Chandan Babu R , "Darrick J. Wong" , Hugh Dickins , Andrew Morton Cc: Hui Su , linux-xfs@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 14/22] xfs: don't try to handle non-update pages in xfile_obj_load Date: Mon, 19 Feb 2024 07:27:22 +0100 Message-Id: <20240219062730.3031391-15-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240219062730.3031391-1-hch@lst.de> References: <20240219062730.3031391-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: rspam08 X-Rspamd-Queue-Id: 1838FC000D X-Stat-Signature: 9zym4rms9x9mxg3hpqikeiin9818ddzy X-Rspam-User: X-HE-Tag: 1708324082-97663 X-HE-Meta: U2FsdGVkX1+wU1ldoDt3Yw4rUuoTI9yq5zo1dF2qsBB56O9dMgXjOoNcHW+jrar5lfY+LFimB8FFq9vCCPvu4supNvtZLy3augb0W3loxp5b3Ae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A9FG6tt9Ek8KpZSB3XXmSOnIyaNCrS8T/0f+x43kV8DKQ2HVRHVEc/Bn6MElIclAzSTxprgMMMgMlY/XfNVeK5zxRitVXshuVpu77um9sW+c5LBfDfQcM/KTKtFEXkKOpCb4oXbzGIu6MjaoN0wO5/HfUbZSTF6QjTNMu2sVjYRxiULoRsVr8CYc1emjD+JD3Vb0iMCmYoElsrDf8EA+ov5rA307kKL3qpmeuBNjktCB3PJpsTjUHlnVTXs16sE0etRyyh/NFwQJf4Dv9d++qj/bs0sSUvgx3yqLfEb9RxbaszA2NCIgZk7X0PkfH0= 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 c15cc886888001..4ec975977dcd4c 100644 --- a/fs/xfs/scrub/xfile.c +++ b/fs/xfs/scrub/xfile.c @@ -149,18 +149,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: