Skip to content

Commit aa00c6d

Browse files
chaseyuJaegeuk Kim
authored and
Jaegeuk Kim
committed
f2fs: support to disable linear lookup fallback
After commit 91b587b ("f2fs: Introduce linear search for dentries"), f2fs forced to use linear lookup whenever a hash-based lookup fails on casefolded directory, it may affect performance for scenarios: a) create a new file w/ filename it doesn't exist in directory, b) lookup a file which may be removed. This patch supports to disable linear lookup fallback, so, once there is a solution for commit 5c26d2f ("unicode: Don't special case ignorable code points") to fix red heart unicode issue, then we can set an encodeing flag to disable the fallback for performance recovery. The way is kept in line w/ ext4, refer to commit 9e28059 ("ext4: introduce linear search for dentries"). Cc: Daniel Lee <[email protected]> Cc: Gabriel Krisman Bertazi <[email protected]> Signed-off-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent d26fecb commit aa00c6d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/f2fs/dir.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,8 @@ struct f2fs_dir_entry *__f2fs_find_entry(struct inode *dir,
366366

367367
out:
368368
#if IS_ENABLED(CONFIG_UNICODE)
369-
if (IS_CASEFOLDED(dir) && !de && use_hash) {
369+
if (!sb_no_casefold_compat_fallback(dir->i_sb) &&
370+
IS_CASEFOLDED(dir) && !de && use_hash) {
370371
use_hash = false;
371372
goto start_find_entry;
372373
}

0 commit comments

Comments
 (0)