Skip to content

Commit 573960c

Browse files
Lizhi Xuopsiff
authored andcommitted
ext4: filesystems without casefold feature cannot be mounted with siphash
commit 985b67c upstream. 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]> [cascardo: small conflict fixup] Signed-off-by: Thadeu Lima de Souza Cascardo <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit 52c4538a92da6f3242d4140c03ddc5ee71b39ba8) Signed-off-by: Wentao Guan <[email protected]>
1 parent 2a73e85 commit 573960c

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

fs/ext4/super.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3639,6 +3639,14 @@ int ext4_feature_set_ok(struct super_block *sb, int readonly)
36393639
}
36403640
#endif
36413641

3642+
if (EXT4_SB(sb)->s_es->s_def_hash_version == DX_HASH_SIPHASH &&
3643+
!ext4_has_feature_casefold(sb)) {
3644+
ext4_msg(sb, KERN_ERR,
3645+
"Filesystem without casefold feature cannot be "
3646+
"mounted with siphash");
3647+
return 0;
3648+
}
3649+
36423650
if (readonly)
36433651
return 1;
36443652

0 commit comments

Comments
 (0)