ext4: Use generic_ci_validate_strict_name helper

Use the helper function to check the requirements for casefold
directories using strict encoding.

Suggested-by: Gabriel Krisman Bertazi <[email protected]>
Signed-off-by: André Almeida <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Acked-by: Theodore Ts'o <[email protected]>
Reviewed-by: Gabriel Krisman Bertazi <[email protected]>
Signed-off-by: Christian Brauner <[email protected]>
This commit is contained in:
André Almeida
2024-10-28 13:36:53 +01:00
committed by Christian Brauner
parent 0e152beb5a
commit 3f5ad0d21d
+1 -4
View File
@@ -2395,11 +2395,8 @@ static int ext4_add_entry(handle_t *handle, struct dentry *dentry,
if (fscrypt_is_nokey_name(dentry))
return -ENOKEY;
#if IS_ENABLED(CONFIG_UNICODE)
if (sb_has_strict_encoding(sb) && IS_CASEFOLDED(dir) &&
utf8_validate(sb->s_encoding, &dentry->d_name))
if (!generic_ci_validate_strict_name(dir, &dentry->d_name))
return -EINVAL;
#endif
retval = ext4_fname_setup_filename(dir, &dentry->d_name, 0, &fname);
if (retval)