[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241021-tonyk-tmpfs-v8-2-f443d5814194@igalia.com>
Date: Mon, 21 Oct 2024 13:37:18 -0300
From: André Almeida <andrealmeid@...lia.com>
To: Gabriel Krisman Bertazi <krisman@...nel.org>,
Alexander Viro <viro@...iv.linux.org.uk>,
Christian Brauner <brauner@...nel.org>, Jan Kara <jack@...e.cz>,
Theodore Ts'o <tytso@....edu>, Andreas Dilger <adilger.kernel@...ger.ca>,
Hugh Dickins <hughd@...gle.com>, Andrew Morton <akpm@...ux-foundation.org>,
Jonathan Corbet <corbet@....net>, smcv@...labora.com
Cc: kernel-dev@...lia.com, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-ext4@...r.kernel.org,
linux-mm@...ck.org, linux-doc@...r.kernel.org,
Gabriel Krisman Bertazi <krisman@...e.de>,
André Almeida <andrealmeid@...lia.com>
Subject: [PATCH v8 2/9] 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@...e.de>
Signed-off-by: André Almeida <andrealmeid@...lia.com>
Acked-by: Theodore Ts'o <tytso@....edu>
Reviewed-by: Gabriel Krisman Bertazi <krisman@...e.de>
---
Changes from v4:
- Now we can drop the if IS_ENABLED() guard
---
fs/ext4/namei.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 790db7eac6c2ad5e1790e363e4ac273162e35013..612ccbeb493b8d901c123221ef6573457193dd16 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)
--
2.47.0
Powered by blists - more mailing lists