Skip to content

Commit 35cc8f2

Browse files
chaseyuJaegeuk Kim
authored andcommitted
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_flags s_encoding_flags [0x 0 : 0] fsck.f2fs /dev/vdb -g android dump.f2fs -d3 /dev/vdb |grep s_encoding_flags s_encoding_flags [0x 2 : 2] Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
1 parent 6382d91 commit 35cc8f2

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

fsck/main.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void fsck_usage()
9191
MSG(0, " --no-kernel-check skips detecting kernel change\n");
9292
MSG(0, " --kernel-check checks kernel change\n");
9393
MSG(0, " --debug-cache to debug cache when -c is used\n");
94-
MSG(0, " --nolinear-lookup=X X=1: disable linear lookup, X=0: enable linear lookup\n");
94+
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");
9595
MSG(0, " --fault_injection=%%d to enable fault injection with specified injection rate\n");
9696
MSG(0, " --fault_type=%%d to configure enabled fault injection type\n");
9797
exit(1);
@@ -224,6 +224,9 @@ static void add_default_options(void)
224224
if (c.func == FSCK) {
225225
/* -a */
226226
c.auto_fix = 1;
227+
228+
/* disable linear lookup by default */
229+
c.nolinear_lookup = LINEAR_LOOKUP_DISABLE;
227230
} else if (c.func == RESIZE) {
228231
c.force = 1;
229232
}

man/fsck.f2fs.8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Specify the level of debugging options.
6868
The default number is 0, which shows basic debugging messages.
6969
.TP
7070
.BI \--nolinear-lookup
71-
Tune linear lookup fallback, must specify an argument, 0: enable linear lookup, 1: disable linear lookup.
71+
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.
7272
.TP
7373
.BI \-\-fault_injection=%d " enable fault injection"
7474
Enable fault injection in all supported types with specified injection rate.

0 commit comments

Comments
 (0)