From mboxrd@z Thu Jan 1 00:00:00 1970 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 lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 409B5CCD184 for ; Tue, 14 Oct 2025 06:27:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type:Cc: Reply-To:From:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Subject:MIME-Version:References:In-Reply-To: Message-ID:Date:To:Sender:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=vJtkFRRsvHk7OJZpWtUyc5KB7ogP5jEbyglNuIxGldg=; b=GGT0WV8ETMPC4WDGfjvK9grQqB oqJAmTwY3JP/YQfKi2EeIXpAODe92KterBtEMD4ojgvqM9JcZiavPzUl0pAGHoy03tjiqGgP/jiJj 4J2LzhmmD4CyOR0E9Weni/hmZ2Wo7b0b/OkpvhgiHtvLZemn+X6oX/zMHmIX8RBatl6A=; Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1v8YVI-00073j-OT; Tue, 14 Oct 2025 06:27:25 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1v8YVI-00073Y-0x for linux-f2fs-devel@lists.sourceforge.net; Tue, 14 Oct 2025 06:27:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; 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:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=r3RsWBV8kgTVyUle6m8vjHFDOgFxQ0VKgGZN1KwAalM=; b=Z+LaJZ49SIFxMkt3MoWFc0rOVU EscXWRh43/Y49xBECGvPsbHCjO2FVzqPak8+r2QjDw+a3pxMvGXBlimR6ssek1sZtYd/tT1AoBQH9 5OWyxmwaNSAcHocnpM++ivGvxzHWluEuN6M5G+ZKogA2abwzp8YqDU/Qe7rQw211ZBaw=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; 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:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=r3RsWBV8kgTVyUle6m8vjHFDOgFxQ0VKgGZN1KwAalM=; b=jUTN//YmOfdbJ1rFXN3Nvq3KfT YWHExzKB06uAWtMjRABMymf9ufESKAxNB4+yDgdyY1uQNjkBz9SwbrbQatxBXInx+Ul4vQrw4+QmT KUoCxfInPKg5PuZSyELZ6szvrHaKe75ViFBQVzLSPS52qYZJ5ILyVnCzkMLzJtmuKwGo=; Received: from sea.source.kernel.org ([172.234.252.31]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1v8YVI-0001iD-EF for linux-f2fs-devel@lists.sourceforge.net; Tue, 14 Oct 2025 06:27:24 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 2B24F4889B for ; Tue, 14 Oct 2025 06:27:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C2F3AC4CEE7; Tue, 14 Oct 2025 06:27:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1760423234; bh=PNTKEmXKtFVp+YUrykXB7+qvHmZ2GbnocnQ5aHbHOFo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lMBrqawULRzvYy0wurRKyyANwKU0YOvBSGJ2zy40SVWKz4mRmwYIRlBJ47cMDgggp hwo3RASu8FI70WBUgEJ/78paOSgtC44iIGy44VWTGeXLO/bvBsHz+FIMaM/UrSZBmH TcooA1nviR3eWioycxFliXC0gDmYV+aNQ0+QnWMrjzxsh7MoyEaSnSyPeOFWy4VVFD 4C+VTDkXfO9y6DgVxH3f15+ySCUimEJ1yW7aZLgpvRgNM0Sj5WvRvFta+z0S/FKl72 d31LFFIOoLNub/DMtJ9dAynQepqgskp7f5WNo4eMiPEsGrt7Z2547HPNzSfXVjbWYE NJNW8RyLUgTJw== To: jaegeuk@kernel.org Date: Tue, 14 Oct 2025 14:27:04 +0800 Message-ID: <20251014062704.1734984-4-chao@kernel.org> X-Mailer: git-send-email 2.51.0.760.g7b8bcc2412-goog In-Reply-To: <20251014062704.1734984-1-chao@kernel.org> References: <20251014062704.1734984-1-chao@kernel.org> MIME-Version: 1.0 X-Headers-End: 1v8YVI-0001iD-EF Subject: [f2fs-dev] [PATCH 4/4] f2fs: use f2fs_filemap_get_folio() to support fault injection X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Chao Yu via Linux-f2fs-devel Reply-To: Chao Yu Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Use f2fs_filemap_get_folio() instead of __filemap_get_folio() in: - f2fs_find_data_folio - f2fs_write_begin - f2fs_read_merkle_tree_page So that, we can trigger fault injection in those places. Signed-off-by: Chao Yu --- fs/f2fs/data.c | 4 ++-- fs/f2fs/verity.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 0279340336be..f993ffed89df 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -1273,7 +1273,7 @@ struct folio *f2fs_find_data_folio(struct inode *inode, pgoff_t index, struct address_space *mapping = inode->i_mapping; struct folio *folio; - folio = __filemap_get_folio(mapping, index, FGP_ACCESSED, 0); + folio = f2fs_filemap_get_folio(mapping, index, FGP_ACCESSED, 0); if (IS_ERR(folio)) goto read; if (folio_test_uptodate(folio)) @@ -3567,7 +3567,7 @@ static int f2fs_write_begin(const struct kiocb *iocb, * Do not use FGP_STABLE to avoid deadlock. * Will wait that below with our IO control. */ - folio = __filemap_get_folio(mapping, index, + folio = f2fs_filemap_get_folio(mapping, index, FGP_LOCK | FGP_WRITE | FGP_CREAT, GFP_NOFS); if (IS_ERR(folio)) { err = PTR_ERR(folio); diff --git a/fs/f2fs/verity.c b/fs/f2fs/verity.c index f0ab9a3c7a82..05b935b55216 100644 --- a/fs/f2fs/verity.c +++ b/fs/f2fs/verity.c @@ -263,7 +263,7 @@ static struct page *f2fs_read_merkle_tree_page(struct inode *inode, index += f2fs_verity_metadata_pos(inode) >> PAGE_SHIFT; - folio = __filemap_get_folio(inode->i_mapping, index, FGP_ACCESSED, 0); + folio = f2fs_filemap_get_folio(inode->i_mapping, index, FGP_ACCESSED, 0); if (IS_ERR(folio) || !folio_test_uptodate(folio)) { DEFINE_READAHEAD(ractl, NULL, NULL, inode->i_mapping, index); -- 2.49.0 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel