fsck: clear unexpected casefold flags
PATCH 1/1 fsck: clear unexpected casefold flags
From: Eric Biggers <[email protected]>
Inodes aren't allowed to have the casefold flag set when they aren't directories, or if the filesystem superblock doesn't have the casefold feature enabled. Clear any such unexpected casefold flags.
Signed-off-by Eric Biggers <[email protected]>
--- fsck/fsck.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
fsck/fsck.c +11 -0
@@ -790,6 +790,17 @@ void fsck_chk_inode_blk(struct f2fs_sb_info *sbi, u32 nid, } ofs =get_extra_isize (node_blk); +if ((node_blk->i.i_flags &cpu_to_le32 (F2FS_CASEFOLD_FL )) && + (ftype !=F2FS_FT_DIR || + !(c.feature &cpu_to_le32 (F2FS_FEATURE_CASEFOLD )))) { +ASSERT_MSG ("[0x%x] unexpected casefold flag" , nid); +if (c.fix_on) { +FIX_MSG ("ino[0x%x] clear casefold flag" , nid); + node_blk->i.i_flags &= ~cpu_to_le32 (F2FS_CASEFOLD_FL ); + need_fix =1 ; + } + } +if ((node_blk->i.i_inline &F2FS_INLINE_DATA )) {unsigned int inline_size =MAX_INLINE_DATA (node_blk);if (cur_qtype !=-1 )
Signature · 8 lines
2.28.0 _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Quoted 7 lines · Eric Biggers
From: Eric Biggers <[email protected]>
Inodes aren't allowed to have the casefold flag set when they aren't directories, or if the filesystem superblock doesn't have the casefold feature enabled. Clear any such unexpected casefold flags.
Signed-off-by Eric Biggers <[email protected]>
Reviewed-by Chao Yu <[email protected]>
Thanks,
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel