Skip to contentSkip to conversation

f2fs: fix to clear dirty flag on folio in error path

PATCH Applied Chao Yu 2 participants 2 messages Aug 5 F2FS file system

lore
Share & tools
lore

Chao Yu

author maintainer
#0 lore raw

PATCH 1/1 f2fs: fix to clear dirty flag on folio in error path

If node block is corrupted due to chksum mismatch or inconsistent footer info, it needs to drop clear flag of node folio, in order to persist inconsistent node data to storage.

Fixes b42b179bda9f ("f2fs: fix to do checksum even if inode page is uptodate")
---
 fs/f2fs/node.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/node.c +1 -1
index 9775fa90636a..a98855b8cc5e 100644
@@ -1618,7 +1618,7 @@ static struct folio *__get_node_folio(struct f2fs_sb_info *sbi, pgoff_t nid,
 	if (!err)
 		return folio;
 out_err:
-	folio_clear_uptodate(folio);
+	clear_node_folio_dirty(folio);
 out_put_err:
 	/* ENOENT comes from read_node_folio which is not an error. */
 	if (err != -ENOENT)
Signature · 1 line
2.49.0
#1 lore raw
This patch was applied to jaegeuk/f2fs.git (dev) by Jaegeuk Kim <[email protected]>:

Hello:

This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <[email protected]>:

Quoted 9 lines · On Wed, 5 Aug 2026 12:29:20 +0000 you wrote:

If node block is corrupted due to chksum mismatch or inconsistent footer info, it needs to drop clear flag of node folio, in order to persist inconsistent node data to storage.

Fixes b42b179bda9f ("f2fs: fix to do checksum even if inode page is uptodate")

[...]

Here is the summary with links:
- [f2fs-dev] f2fs: fix to clear dirty flag on folio in error path

    https://git.kernel.org/jaegeuk/f2fs/c/5b86eab84ac8

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html