fsck.f2fs: tune linear_lookup in f2fs_do_mount()
PATCH v2 1/1 fsck.f2fs: tune linear_lookup in f2fs_do_mount()
In order to avoid failing to tune linear_lookup if auto or preen mode is on.
Cc Daniel Lee <[email protected]>
Signed-off-by Chao Yu <[email protected]>
---
v2:
- remove unneeded f2fs_fs.h
- remove unneeded "\n"
fsck/fsck.c | 20 +++++++++----------- fsck/main.c | 2 -- fsck/mount.c | 2 ++ 3 files changed, 11 insertions(+), 13 deletions(-)
fsck/fsck.c +9 -11
@@ -2369,26 +2369,24 @@ void fsck_update_sb_flags(struct f2fs_sb_info *sbi)struct f2fs_super_block *sb =F2FS_RAW_SUPER (sbi);u16 flags =get_sb (s_encoding_flags); -if (c.nolinear_lookup ==LINEAR_LOOKUP_DISABLE ) { +if (c.nolinear_lookup ==LINEAR_LOOKUP_DEFAULT ) { +INFO_MSG ("Casefold: linear_lookup [%s]" , +get_sb (s_encoding_flags) &F2FS_ENC_NO_COMPAT_FALLBACK_FL ? +"disable" :"enable" ); + }else if (c.nolinear_lookup ==LINEAR_LOOKUP_DISABLE ) {if (!(flags &F2FS_ENC_NO_COMPAT_FALLBACK_FL )) { flags |=F2FS_ENC_NO_COMPAT_FALLBACK_FL ;set_sb (s_encoding_flags, flags); - c.fix_on =1 ; - c.invalid_sb |=SB_ENCODE_FLAG ; -INFO_MSG ("Casefold: disable linear lookup\n" ); +INFO_MSG ("Casefold: disable linear lookup" ); +update_superblock (sbi->raw_super,SB_MASK_ALL ); } }else if (c.nolinear_lookup ==LINEAR_LOOKUP_ENABLE ) {if (flags &F2FS_ENC_NO_COMPAT_FALLBACK_FL ) { flags &= ~F2FS_ENC_NO_COMPAT_FALLBACK_FL ;set_sb (s_encoding_flags, flags); - c.fix_on =1 ; - c.invalid_sb |=SB_ENCODE_FLAG ; -INFO_MSG ("Casefold: enable linear lookup\n" ); +INFO_MSG ("Casefold: enable linear lookup" ); +update_superblock (sbi->raw_super,SB_MASK_ALL ); } - }else { -INFO_MSG ("Casefold: linear_lookup [%s]\n" , -get_sb (s_encoding_flags) &F2FS_ENC_NO_COMPAT_FALLBACK_FL ? -"disable" :"enable" ); } }
fsck/main.c +0 -2
@@ -1004,8 +1004,6 @@ static int do_fsck(struct f2fs_sb_info *sbi) F2FS_FT_DIR, TYPE_INODE, &blk_cnt, &cbc, &child);fsck_chk_quota_files (sbi); -fsck_update_sb_flags (sbi); - ret =fsck_verify (sbi);fsck_free (sbi);
fsck/mount.c +2 -0
@@ -4117,6 +4117,8 @@ int f2fs_do_mount(struct f2fs_sb_info *sbi)update_superblock (sbi->raw_super,SB_MASK_ALL ); }#else +fsck_update_sb_flags (sbi); +if (!c.no_kernel_check) {u32 prev_time, cur_time, time_diff; __le32 *ver_ts_ptr = (__le32 *)(sbi->raw_super->version
Signature · 8 lines
2.49.0 _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel