fsck.f2fs: disable linear lookup by default
PATCH 1/1 fsck.f2fs: disable linear lookup by default
As we know, Android is the only user of casefold feature, in casefolded directory, creating a filename w/ character has ignorable code points in buggy kernel v6.12 is a very rare case, we don't get any report that user can not access file w/ character has ignorable code points till now.
Let's disable linear lookup in fsck for Android by default, once there is any related bug report of unicode code points, we can enable it again.
mkfs.f2fs -f -O casefold -C utf8 /dev/vdb
dump.f2fs -d3 /dev/vdb |grep s_encoding_flagss_encoding_flags [0x 0 : 0]
fsck.f2fs /dev/vdb -g android
dump.f2fs -d3 /dev/vdb |grep s_encoding_flagss_encoding_flags [0x 2 : 2]
--- fsck/main.c | 5 ++++- man/fsck.f2fs.8 | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-)
fsck/main.c +4 -1
@@ -91,7 +91,7 @@ void fsck_usage()MSG (0 ," --no-kernel-check skips detecting kernel change\n" );MSG (0 ," --kernel-check checks kernel change\n" );MSG (0 ," --debug-cache to debug cache when -c is used\n" ); -MSG (0 ," --nolinear-lookup=X X=1: disable linear lookup, X=0: enable linear lookup\n" ); +MSG (0 ," --nolinear-lookup=X X=1: disable linear lookup, X=0: enable linear lookup. For android case, it will disable linear lookup by default\n" );MSG (0 ," --fault_injection=%%d to enable fault injection with specified injection rate\n" );MSG (0 ," --fault_type=%%d to configure enabled fault injection type\n" );exit (1 );
@@ -224,6 +224,9 @@ static void add_default_options(void)if (c.func ==FSCK ) {/* -a */ c.auto_fix =1 ; + +/* disable linear lookup by default */ + c.nolinear_lookup =LINEAR_LOOKUP_DISABLE ; }else if (c.func ==RESIZE ) { c.force =1 ; }
man/fsck.f2fs.8 +1 -1
@@ -68,7 +68,7 @@ Specify the level of debugging options. The default number is 0, which shows basic debugging messages. .TP .BI \--nolinear-lookup -Tune linear lookup fallback, must specify an argument, 0: enable linear lookup, 1: disable linear lookup. +Tune linear lookup fallback, must specify an argument, 0: enable linear lookup, 1: disable linear lookup. For android case, it will disable linear lookup by default. .TP .BI \-\-fault_injection=%d " enable fault injection" Enable fault injection in all supported types with specified injection rate.
Signature · 8 lines
2.49.0 _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel