diff options
author | Wu Bo <bo.wu@vivo.com> | 2023-12-14 03:01:48 -0700 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2023-12-15 15:07:41 -0800 |
commit | fa3bb83a488d0e8f50a39cfaa91d008828a3ef44 (patch) | |
tree | 43274dc1d49c2e21a18eab29aeda6e2228d8c439 | |
parent | bf5100606d63f6928799846b7322aa6f3f158bcf (diff) | |
download | f2fs-tools-fa3bb83a488d0e8f50a39cfaa91d008828a3ef44.tar.gz |
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")
Signed-off-by: Wu Bo <bo.wu@vivo.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r-- | fsck/fsck.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) { |