mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-25 03:22:39 +00:00
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 <krisman@suse.de> Signed-off-by: André Almeida <andrealmeid@igalia.com> Link: https://lore.kernel.org/r/20241021-tonyk-tmpfs-v8-2-f443d5814194@igalia.com Acked-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Gabriel Krisman Bertazi <krisman@suse.de> Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
committed by
Christian Brauner
parent
0e152beb5a
commit
3f5ad0d21d
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user