lkml.org 
[lkml]   [2023]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] fsck.f2fs: fix orphan inode check fail
Date
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")
Signed-off-by: Wu Bo <bo.wu@vivo.com>
---
fsck/fsck.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fsck/fsck.c b/fsck/fsck.c
index e93db82..3461a52 100644
--- a/fsck/fsck.c
+++ b/fsck/fsck.c
@@ -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) {
--
2.25.1
\
 
 \ /
  Last update: 2023-12-14 10:53    [W:0.054 / U:0.312 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site