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

Kevin Paul Reddy Janagari posted 1 patch 8 months, 1 week ago
fs/ext4/super.c | 9 +++++++++
1 file changed, 9 insertions(+)
[PATCH] ext4: filesystems without casefold feature cannot be mounted
Posted by Kevin Paul Reddy Janagari 8 months, 1 week ago
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@gmail.com>
---
 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
Re: [PATCH] ext4: filesystems without casefold feature cannot be mounted
Posted by Theodore Ts'o 8 months, 1 week ago
On Sun, Apr 13, 2025 at 10:27:18AM +0530, Kevin Paul Reddy Janagari wrote:
> 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@gmail.com>

I believe the problem you are concerned with was fixed by commit
a2187431c395 ("ext4: fix error message when rejecting the default
hash")

And I'm not sure what you meant by your reference to the merge
conflict?  Were you trying to cherry-pick 985b67cd8639 into some other
tree or branch, and that was where you saw the merge conflict?

     		    	     	       - Ted