Skip to contentSkip to conversation

fsck.f2fs: fix orphan inode check fail

PATCH New Wu Bo 1 participant 1 message Dec 14, 2023

lore
Share & tools
lore

Wu Bo

author
#0 lore raw

PATCH 1/1 fsck.f2fs: fix orphan inode check fail

Call path:
fsck_chk_orphan_node
fsck_chk_node_blk
fsck_chk_inode_blk

'F2FS_FT_ORPHAN' will pass to fsck_chk_inode_blk(). If the orphan inode is a DIR, it will be wrongly fixed.

Fixes 8fd836f ("fsck: clear unexpected casefold flags")
---
 fsck/fsck.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fsck/fsck.c +1 -1
index e93db82..3461a52 100644
@@ -1052,7 +1052,7 @@ check_next:
 	ofs = get_extra_isize(node_blk);
 
 	if ((node_blk->i.i_flags & cpu_to_le32(F2FS_CASEFOLD_FL)) &&
-	    (ftype != F2FS_FT_DIR ||
+	    (!S_ISDIR(le16_to_cpu(node_blk->i.i_mode)) ||
 	     !(c.feature & F2FS_FEATURE_CASEFOLD))) {
 		ASSERT_MSG("[0x%x] unexpected casefold flag", nid);
 		if (c.fix_on) {
Signature · 8 lines
2.25.1



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel