diff options
author | André Almeida <andrealmeid@igalia.com> | 2024-10-21 13:37:18 -0300 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2024-10-28 13:36:53 +0100 |
commit | 3f5ad0d21db80e31894de4c49874ef5dfc5999a7 (patch) | |
tree | bcc4c3f33332c3e13539f65599115da2d7d9eb60 /fs/ext4 | |
parent | 0e152beb5aa1ccdac9aae9fa570a9e039aff7a03 (diff) | |
download | lwn-3f5ad0d21db80e31894de4c49874ef5dfc5999a7.tar.gz lwn-3f5ad0d21db80e31894de4c49874ef5dfc5999a7.zip |
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>
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/namei.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 790db7eac6c2..612ccbeb493b 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -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) |