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 7BADCFD064E for ; Wed, 11 Mar 2026 08:39:56 +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:In-Reply-To:References:To:MIME-Version:Date: Message-ID:Sender:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ZhW1qmNVul+FOmFDsoEG24rp+YrfAE505VP2qbRAUR0=; b=drX4sWz93Wjhr0Owq0NNmOyaAG 1Uq8KLAOP1fDGalOMzkruMtA088hfHnXPuKwsV0dU2upiaEjobVqaxoIaZEzSJn8h6CNfuMw0XNEW 5rrXsPZgvr5pE8BNX0SjAp/FNVUFCjUsax7T4QTeukYvf4jV7JBo5MRmk1C4UkuMWgFU=; Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1w0F6h-0004K7-BI; Wed, 11 Mar 2026 08:39:55 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1w0F6L-0004IX-1M for linux-f2fs-devel@lists.sourceforge.net; Wed, 11 Mar 2026 08:39:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: From:References:To:Subject:Cc:MIME-Version:Date:Message-ID:Sender:Reply-To: 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=Bxfe0hd5KBGPb3mFOyQc8D4WO+k9XrbqxvceJhCqu5s=; b=P6dgvtl/xhM0F2iAXuHPLizLXa aLZvv+gIFAwwLdTlExOAgYI4Wd/lCoXru175FWeqiTeJlEg+iXLwW/WOs8jSunIDybEuvEgXD4D5I pooQ9Mn5ng4tHotNWV8fbMziI1WtWvH+KYsOtQbUAca3LjgyEx6NTzIlXGHy5dcQCalM=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:References:To: Subject:Cc:MIME-Version:Date:Message-ID:Sender:Reply-To: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=Bxfe0hd5KBGPb3mFOyQc8D4WO+k9XrbqxvceJhCqu5s=; b=TqCE6QMo1K26fdLT0JbhCLBNdw 52ayfLnpSFvH1B1OPitt378A3zXYJfotgivSpB4m0es4wSBqmhvJV/2gP0TNx3Ol8ELfp1zz8EjhP 7CDyMyTSB2KybMuLn4b4U5i5xPtT1FkYQko/oE6DmvcyESuAqtgB3Pzp7bJo0NPD5aU8=; Received: from tor.source.kernel.org ([172.105.4.254]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1w0F6K-00054L-I6 for linux-f2fs-devel@lists.sourceforge.net; Wed, 11 Mar 2026 08:39:32 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id DB7FE6132F; Wed, 11 Mar 2026 08:39:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6866FC2BCAF; Wed, 11 Mar 2026 08:39:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773218366; bh=oQRv0HFLAso2Di2MF4JKPrPrBU61XFXo4Hng9HCTG5k=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=PgFNXXv+oGNKEOPilZrjX1Ud6qZuzSHbHtS7+VvtOZaEizvjCFQTLtVNrAmHMFZvU BG0mXwwnONa0dt2ricjxP0KWAoxnSOo5lotxFBUpmKsni0f1v6jpmo0Dm4WamageP4 YOOzE+1/RI90Fgp2U60QblZp1Uwr0RITdOC7ejauKELmZ3Mr8aQ2TCR5k2vKxvDukX rtgwzQXiCTRHgBu8o2vVwJtx2PR4G+j8DQpmtOaNUjlMH3sH+uqYDOHjZvB+xs7f5Y mGibHk+z9nHR89yaA4EK0+pdg80XylgD/KS4XTRudy5+1m/1cjn+YQAKzgkN9rd/ft 6dBzOVs6Fvo/Q== Message-ID: <3c04a285-7161-4e4c-884e-ca96bb818d3b@kernel.org> Date: Wed, 11 Mar 2026 16:39:22 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Yongpeng Yang , Jaegeuk Kim References: <20260310093611.2865092-2-monty_pavel@sina.com> <20260310093611.2865092-4-monty_pavel@sina.com> Content-Language: en-US In-Reply-To: <20260310093611.2865092-4-monty_pavel@sina.com> X-Headers-End: 1w0F6K-00054L-I6 Subject: Re: [f2fs-dev] [PATCH 1/2] f2fs: fix fsck inconsistency caused by incorrect nat_entry flag usage 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: Yongpeng Yang , 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 On 3/10/26 17:36, Yongpeng Yang wrote: > From: Yongpeng Yang > > f2fs_need_dentry_mark() reads nat_entry flags without mutual exclusion > with the checkpoint path, which can result in an incorrect inode block > marking state. The scenario is as follows: > > create & write & fsync 'file A' write checkpoint > - f2fs_do_sync_file // inline inode > - f2fs_write_inode // inode folio is dirty > - f2fs_write_checkpoint > - f2fs_flush_merged_writes > - f2fs_sync_node_pages > - f2fs_fsync_node_pages // no dirty node > - f2fs_need_inode_block_update // return true > - f2fs_fsync_node_pages // inode dirtied > - f2fs_need_dentry_mark //return true > - f2fs_flush_nat_entries > - f2fs_write_checkpoint end > - __write_node_folio // inode with DENT_BIT_SHIFT set > SPO, "fsck --dry-run" find inode has already checkpointed but still > with DENT_BIT_SHIFT set > > The state observed by f2fs_need_dentry_mark() can differ from the state > observed in __write_node_folio() after acquiring sbi->node_write. The > root cause is that the semantics of IS_CHECKPOINTED and > HAS_FSYNCED_INODE are only guaranteed after the checkpoint write has > fully completed. > > This patch moves set_dentry_mark() into __write_node_folio() and > protects it with the sbi->node_write lock. > Cc: stable@kernel.org > Fixes: 88bd02c9472a ("f2fs: fix conditions to remain recovery information in f2fs_sync_file") > Signed-off-by: Yongpeng Yang Reviewed-by: Chao Yu Thanks, _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel