Skip to content

Commit 3f5ad0d

Browse files
andrealmeidbrauner
authored andcommitted
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]>
1 parent 0e152be commit 3f5ad0d

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

fs/ext4/namei.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2395,11 +2395,8 @@ static int ext4_add_entry(handle_t *handle, struct dentry *dentry,
23952395
if (fscrypt_is_nokey_name(dentry))
23962396
return -ENOKEY;
23972397

2398-
#if IS_ENABLED(CONFIG_UNICODE)
2399-
if (sb_has_strict_encoding(sb) && IS_CASEFOLDED(dir) &&
2400-
utf8_validate(sb->s_encoding, &dentry->d_name))
2398+
if (!generic_ci_validate_strict_name(dir, &dentry->d_name))
24012399
return -EINVAL;
2402-
#endif
24032400

24042401
retval = ext4_fname_setup_filename(dir, &dentry->d_name, 0, &fname);
24052402
if (retval)

0 commit comments

Comments
 (0)