[PATCH v4 02/10] ext4: Use generic_ci_validate_strict_name helper

André Almeida posted 10 patches 2 months, 2 weeks ago
There is a newer version of this series
[PATCH v4 02/10] ext4: Use generic_ci_validate_strict_name helper
Posted by André Almeida 2 months, 2 weeks ago
Use the helper function to check the requirements for casefold
directories using strict encoding.

Suggested-by: Gabriel Krisman Bertazi <gabriel@krisman.be>
Signed-off-by: André Almeida <andrealmeid@igalia.com>
Acked-by: Theodore Ts'o <tytso@mit.edu>
---
 fs/ext4/namei.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 6a95713f9193..beca80e70b0c 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -2394,8 +2394,7 @@ static int ext4_add_entry(handle_t *handle, struct dentry *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
 
-- 
2.46.0

Re: [PATCH v4 02/10] ext4: Use generic_ci_validate_strict_name helper
Posted by Gabriel Krisman Bertazi 2 months, 2 weeks ago
André Almeida <andrealmeid@igalia.com> writes:

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

Reviewed-by: Gabriel Krisman Bertazi <krisman@suse.de>

-- 
Gabriel Krisman Bertazi