Skip to content

Commit 985b67c

Browse files
Lizhi Xutytso
authored andcommitted
ext4: filesystems without casefold feature cannot be mounted with siphash
When mounting the ext4 filesystem, if the default hash version is set to DX_HASH_SIPHASH but the casefold feature is not set, exit the mounting. Reported-by: [email protected] Signed-off-by: Lizhi Xu <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent a3c3eec commit 985b67c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

fs/ext4/super.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3582,6 +3582,13 @@ int ext4_feature_set_ok(struct super_block *sb, int readonly)
35823582
"mounted without CONFIG_UNICODE");
35833583
return 0;
35843584
}
3585+
if (EXT4_SB(sb)->s_es->s_def_hash_version == DX_HASH_SIPHASH &&
3586+
!ext4_has_feature_casefold(sb)) {
3587+
ext4_msg(sb, KERN_ERR,
3588+
"Filesystem without casefold feature cannot be "
3589+
"mounted with siphash");
3590+
return 0;
3591+
}
35853592

35863593
if (readonly)
35873594
return 1;

0 commit comments

Comments
 (0)