hc
2024-10-09 05e59e5fb0064c97a1c10921ecd549f2d4a58565
kernel/fs/ext4/hash.c
....@@ -233,6 +233,7 @@
233233 break;
234234 case DX_HASH_HALF_MD4_UNSIGNED:
235235 str2hashbuf = str2hashbuf_unsigned;
236
+ fallthrough;
236237 case DX_HASH_HALF_MD4:
237238 p = name;
238239 while (len > 0) {
....@@ -246,6 +247,7 @@
246247 break;
247248 case DX_HASH_TEA_UNSIGNED:
248249 str2hashbuf = str2hashbuf_unsigned;
250
+ fallthrough;
249251 case DX_HASH_TEA:
250252 p = name;
251253 while (len > 0) {
....@@ -294,7 +296,8 @@
294296 unsigned char *buff;
295297 struct qstr qstr = {.name = name, .len = len };
296298
297
- if (len && needs_casefold(dir) && um) {
299
+ if (len && IS_CASEFOLDED(dir) && um &&
300
+ (!IS_ENCRYPTED(dir) || fscrypt_has_encryption_key(dir))) {
298301 buff = kzalloc(sizeof(char) * PATH_MAX, GFP_KERNEL);
299302 if (!buff)
300303 return -ENOMEM;