From patchwork Sun Jan 8 16:56:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13092604 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 A0AA7C53210 for ; Sun, 8 Jan 2023 16:57:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3890F900006; Sun, 8 Jan 2023 11:57:20 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2C636900003; Sun, 8 Jan 2023 11:57:20 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0C7CE900006; Sun, 8 Jan 2023 11:57:19 -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 CE7B6900003 for ; Sun, 8 Jan 2023 11:57:19 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id A8389A010E for ; Sun, 8 Jan 2023 16:57:19 +0000 (UTC) X-FDA: 80332237398.09.07BBF13 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf04.hostedemail.com (Postfix) with ESMTP id 34C794000A for ; Sun, 8 Jan 2023 16:57:18 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=XAeNW8Pv; spf=none (imf04.hostedemail.com: domain of BATV+58c3238fb6e66237551a+7077+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+58c3238fb6e66237551a+7077+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1673197038; a=rsa-sha256; cv=none; b=YV7MpSoxcsclbiNGem2ft4npZJjwTmZkoMcBbQsDR0x6N2LHkrCo+2fxTz6b+9Yrgudl7S ZMtimLFfTw6Lhhqpe8tdPTwRNLXEHuIb/KKSj5NJbHP+1hn6h66KgnMXf2qe8GkkwpESC7 wzAkia2rTTipjkivRz4D+F2BZ611Jr4= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=XAeNW8Pv; spf=none (imf04.hostedemail.com: domain of BATV+58c3238fb6e66237551a+7077+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+58c3238fb6e66237551a+7077+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=1673197038; 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=0rSqpARFgQRqBHywsTtuZPRrJbLJdUkqrGBn/TckkNw=; b=b17jJbiK1Yl1y8yVcgvfyYGoGP0SFXXWq5G7Go4aI3QZE8qJ1MWpcvZwEW4saR7GoWjNlI BRE/DGUjL8kKp6UTY3A41+ODyYkD+4NZA52tmv5AXESg8Eal+OsFrFN5ac602tJTquwhRY AiG8e32DagY0vr81ZcDk+S+Ve3SZ5p0= 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=0rSqpARFgQRqBHywsTtuZPRrJbLJdUkqrGBn/TckkNw=; b=XAeNW8PvyrIFuzPCKY54kLv+Iq Nr0c94bBAgRDDYDs5fmWgHLdSM4wuFdpF0unhRSD05WKElizN+oMfOJkw/ZCfBExPH0+8eVVmc912 7+oPJRHsL5+w9Rpr4VxeL7F5SeY7g5CAteFbTDP2J+gJgCxiyFQkNBrhF7Pa7ERmrkiZnVL3g6aDV OCLJZQzxEq9s12LkEeWA6DqmpS49TRyZ/uVPnrptKfZ9FZYtvU/2AZ6auVcSG1Wcrk3eL9/aU8x7+ JbJbDjelN9hkQfgxThV2QIF6AWhJ18L87Zumj5Z/1nBQW32E6qDIlVj/jLl4R6qHf834ghBLWQjiE TsSGua7Q==; Received: from [2001:4bb8:198:a591:1c7c:bf66:af15:b282] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1pEYym-00ERu3-AK; Sun, 08 Jan 2023 16:57:04 +0000 From: Christoph Hellwig To: Andrew Morton , Chris Mason , Josef Bacik , David Sterba , Dave Kleikamp , Mark Fasheh , Joel Becker , Joseph Qi , Evgeniy Dushistov , "Matthew Wilcox (Oracle)" Cc: linux-btrfs@vger.kernel.org, jfs-discussion@lists.sourceforge.net, ocfs2-devel@oss.oracle.com, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 6/7] ocfs2: don't use write_one_page in ocfs2_duplicate_clusters_by_page Date: Sun, 8 Jan 2023 17:56:44 +0100 Message-Id: <20230108165645.381077-7-hch@lst.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230108165645.381077-1-hch@lst.de> References: <20230108165645.381077-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-Rspam-User: X-Rspamd-Queue-Id: 34C794000A X-Rspamd-Server: rspam01 X-Stat-Signature: bhe5jizppqqp57ruyp1jmsauqan4ffdb X-HE-Tag: 1673197038-414712 X-HE-Meta: U2FsdGVkX1/uZ43eHk5C3oyfa7CA2SPrywNGeOl/RR4FEZqPlaG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ap9AES0b/cclKxkD9koOgvlwbBzfiSnOqrXXAA9d38/l9ql09naObytSMl1eOt406dV/DZamgzwmqZEzRhYGsqzj6MqWkc= 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: Use filemap_write_and_wait_range to write back the range of the dirty page instead of write_one_page in preparation of removing write_one_page and eventually ->writepage. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Reviewed-by: Joseph Qi --- fs/ocfs2/refcounttree.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c index 623db358b1efa8..4a73405962ec4f 100644 --- a/fs/ocfs2/refcounttree.c +++ b/fs/ocfs2/refcounttree.c @@ -2952,10 +2952,11 @@ int ocfs2_duplicate_clusters_by_page(handle_t *handle, */ if (PAGE_SIZE <= OCFS2_SB(sb)->s_clustersize) { if (PageDirty(page)) { - /* - * write_on_page will unlock the page on return - */ - ret = write_one_page(page); + unlock_page(page); + put_page(page); + + ret = filemap_write_and_wait_range(mapping, + offset, map_end - 1); goto retry; } }