[PATCH] ext4: filesystems without casefold feature cannot be mounted

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



commit 985b67cd8639 ("ext4: filesystems without casefold feature cannot be
mounted with siphash") upstream

CONFLICT: A condition above this was wrapped in #ifdef making git not
able to merge them: Merge conflict

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.

compile tested
Signed-off-by: Kevin Paul Reddy Janagari <kevinpaul468@xxxxxxxxx>
---
 fs/ext4/super.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 541cfd118fbc..9bf073bec190 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3192,6 +3192,15 @@ int ext4_feature_set_ok(struct super_block *sb, int readonly)
 	}
 #endif
 
+	if (EXT4_SB(sb)->s_es->s_def_hash_version == DX_HASH_SIPHASH &&
+			!ext4_has_feature_casefold(sb)) {
+		ext4_msg(sb, KERN_ERR,
+				"Filesystem without casefold feature cannot be "
+				"mounted with siphash");
+		return 0;
+	}
+
+
 	if (readonly)
 		return 1;
 
-- 
2.39.5





[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux