fsck.f2fs: honor --linear-lookup=X for Android case
PATCH 1/1 fsck.f2fs: honor --linear-lookup=X for Android case
Behavior summary:
Android Distro
By default disabled enabled
Android case:
1) enabled -> disabled
- mkfs.f2fs -f -g android -O casefold -C utf8:nohashonly /dev/vdb
- dump.f2fs -d3 /dev/vdb |grep s_encoding_flagss_encoding_flags [0x 0 : 0]
- fsck.f2fs -g android --nolinear-lookup=1 /dev/vdb
- dump.f2fs -d3 /dev/vdb |grep s_encoding_flagss_encoding_flags [0x 2 : 2]
- mkfs.f2fs -f -g android -O casefold -C utf8:nohashonly /dev/vdb
- dump.f2fs -d3 /dev/vdb |grep s_encoding_flagss_encoding_flags [0x 0 : 0]
- fsck.f2fs -g android /dev/vdb
- dump.f2fs -d3 /dev/vdb |grep s_encoding_flagss_encoding_flags [0x 2 : 2]
2) disabled -> enabled
- mkfs.f2fs -f -g android -O casefold -C utf8:hashonly /dev/vdb
- dump.f2fs -d3 /dev/vdb |grep s_encoding_flagss_encoding_flags [0x 2 : 2]
- fsck.f2fs -g android --nolinear-lookup=0 /dev/vdb
- dump.f2fs -d3 /dev/vdb |grep s_encoding_flagss_encoding_flags [0x 0 : 0]
Distro case:
1) enabled -> disabled
- mkfs.f2fs -f -O casefold -C utf8:nohashonly /dev/vdb
- dump.f2fs -d3 /dev/vdb |grep s_encoding_flagss_encoding_flags [0x 0 : 0]
- fsck.f2fs --nolinear-lookup=1 /dev/vdb
- dump.f2fs -d3 /dev/vdb |grep s_encoding_flagss_encoding_flags [0x 2 : 2]
2) disabled -> enabled
- mkfs.f2fs -f -O casefold -C utf8:hashonly /dev/vdb
- dump.f2fs -d3 /dev/vdb |grep s_encoding_flagss_encoding_flags [0x 2 : 2]
- fsck.f2fs --nolinear-lookup=0 /dev/vdb
- dump.f2fs -d3 /dev/vdb |grep s_encoding_flagss_encoding_flags [0x 0 : 0]
3) default
- mkfs.f2fs -f -O casefold -C utf8:hashonly /dev/vdb
- dump.f2fs -d3 /dev/vdb |grep s_encoding_flagss_encoding_flags [0x 2 : 2]
- fsck.f2fs /dev/vdb
- dump.f2fs -d3 /dev/vdb |grep s_encoding_flagss_encoding_flags [0x 2 : 2]
- mkfs.f2fs -f -O casefold -C utf8:nohashonly /dev/vdb
- dump.f2fs -d3 /dev/vdb |grep s_encoding_flagss_encoding_flags [0x 0 : 0]
- fsck.f2fs /dev/vdb
- dump.f2fs -d3 /dev/vdb |grep s_encoding_flagss_encoding_flags [0x 0 : 0]
--- fsck/fsck.c | 9 +++++++++ fsck/main.c | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-)
fsck/fsck.c +9 -0
@@ -2425,6 +2425,15 @@ 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); +/* handle default option for Android case */ +if ((c.nolinear_lookup ==LINEAR_LOOKUP_DEFAULT ) && + c.disabled_feature &F2FS_FEATURE_LINEAR_LOOKUP ) { + c.nolinear_lookup =LINEAR_LOOKUP_DISABLE ; +MSG (0 ,"Info: set default linear_lookup option: %s\n" , + c.nolinear_lookup ==LINEAR_LOOKUP_DISABLE ? +"disable" :"enable" ); + } +if (c.nolinear_lookup ==LINEAR_LOOKUP_DEFAULT ) { MSG(0, "Info: Casefold: linear_lookup [%s]\n", get_sb(s_encoding_flags) & F2FS_ENC_NO_COMPAT_FALLBACK_FL ?
fsck/main.c +1 -1
@@ -226,7 +226,7 @@ static void add_default_options(void) c.auto_fix =1 ;/* disable linear lookup by default */ - c.nolinear_lookup =LINEAR_LOOKUP_DISABLE ; + c.disabled_feature |=F2FS_FEATURE_LINEAR_LOOKUP ; }else if (c.func ==RESIZE ) { c.force =1 ; }
Signature · 8 lines
2.49.0 _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel