From patchwork Mon Jan 29 14:34: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: 13535768 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 EEE4FC47DB3 for ; Mon, 29 Jan 2024 14:35:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 851806B00AC; Mon, 29 Jan 2024 09:35:46 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7B4EC6B00AD; Mon, 29 Jan 2024 09:35:46 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 654EE6B00AE; Mon, 29 Jan 2024 09:35:46 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 4D98E6B00AC for ; Mon, 29 Jan 2024 09:35:46 -0500 (EST) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 242BF14013E for ; Mon, 29 Jan 2024 14:35:46 +0000 (UTC) X-FDA: 81732597492.16.18E56A1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf17.hostedemail.com (Postfix) with ESMTP id 6B1AB4000E for ; Mon, 29 Jan 2024 14:35:44 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=Nzpvnqy2; dmarc=none; spf=none (imf17.hostedemail.com: domain of BATV+95c35c30fd22f84c25d9+7463+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+95c35c30fd22f84c25d9+7463+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=1706538944; 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=VBMnYiHUTy7655pcnT9usPoaFW51FWY1eVzzfyzVUWCfXYLq7oGqm3S2A8lIGuBGdlq2LS 5Qd8aYMHfZLPaXzCdDAwhsMGbuxsBxBFE3aN/oVgxEIfi6Z0wAe4bv7G0gbYFukdU4UJQv ZCjKLceSEi0slQptJCVdEAZKd/lf4hE= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=Nzpvnqy2; dmarc=none; spf=none (imf17.hostedemail.com: domain of BATV+95c35c30fd22f84c25d9+7463+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+95c35c30fd22f84c25d9+7463+infradead.org+hch@bombadil.srs.infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706538944; a=rsa-sha256; cv=none; b=GPc+W5OUi4c8ZOTP9uI/uOxHjUcL4FQJfaOsS8PY6ban8fpAy1ErMbvUGozfXTKVhGEoTT x+Z/CBDieu+SqmNT8Ek/CdSBACAPp+DrgqB8bajI5utJdws20+Stc/r3FTbdllN4zimdrv 7esWIcUw2B1MXESWnFvylk8VhzFI/44= 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=Nzpvnqy25fBuewAn8a4fPzk8TC GpboyE4dwrfTM4LUihBf4GKSMM5SXJ3aU1ksr79KJPbn/xfAu5ODCCRb+cqcQmI1u3Hp2m1MO1ik9 MWBRQnZdHLJNiVNjLfr8pTwJKhKZwlMDtu3hIPJZEj/W/xDB/RHV6QUlrHo0PNhqd3FCxhRtEpLNE NcVY+9aBGRDx9WDU9meX66LEF7x7v+FbhqwxA4YrRQwts6qpO1n9fDuFUjGfV/H0nmm336P2CCyc0 Tr1iC8yW5cdnonXAubc2ZY7TlR9VcqBCMAJIVhFElv68l8C5ljn+4SxEB1oQXXnhOCvMKaMJYYRui C7kC1kEQ==; Received: from [2001:4bb8:182:6550:c70:4a89:bc61:3] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1rUSjd-0000000D6Hw-2zun; Mon, 29 Jan 2024 14:35:42 +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/20] xfs: don't try to handle non-update pages in xfile_obj_load Date: Mon, 29 Jan 2024 15:34:52 +0100 Message-Id: <20240129143502.189370-11-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240129143502.189370-1-hch@lst.de> References: <20240129143502.189370-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: 6B1AB4000E X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: kho7zbsz7koeiad38quzdcmjcu9jm17g X-HE-Tag: 1706538944-41311 X-HE-Meta: U2FsdGVkX1/lhTOivCYrYMnG3cOMvkKmor77+04CkbLqZXJYhml4z3/W83Otz5yiPDFVxxx5Ef2xqxNauMnm1TiMXz2bXWUQe6IcNhJ2EPNs4koNxOdk4fcPs+hXVON8dBJfvRi/VifH0zYT2cU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yZvBD1Mmbu9/jV5qReOoTw2Vf7LfUgA98ZLFB2Hys4CgIi3k0qrCkt+9MTIL9KyTOaJ5Jf9nqpj/xBg/FQ82Nu2xh89wrGi75Y+TRK9VgkgO+QriwI1NRLBNJqeBDPqlBXCQagNDRzbJOgQGiQc3wzjinRGpdLbbbrRIW0I7Bk0mseVzs825tPS7eCEh8FMZGc9N53l1YkPJnlb+S8gOCAJ5LiC8EEwgJy0wWS4iRhlT5/38SbSY3EWXSS6vcwt0q7yq6y9R5+VrOXQq1f1Vst3I/TJEHtdL6ynZ6dzRGbtZfIqMwfEM= 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: