Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ext4: make error code in __ext4fs_dirhash() consistent.

Currently __ext4fs_dirhash() returns -1 (-EPERM) if fscrypt doesn't
have encryption key, which may confuse users. Make the error code here
consistent with existing error code.

Signed-off-by: Julian Sun <sunjunchao@bytedance.com>
Message-ID: <20251010095257.3008275-1-sunjunchao@bytedance.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>

authored by

Julian Sun and committed by
Theodore Ts'o
ce3236a3 6146a0f1

+1 -1
+1 -1
fs/ext4/hash.c
··· 268 268 combined_hash = fscrypt_fname_siphash(dir, &qname); 269 269 } else { 270 270 ext4_warning_inode(dir, "Siphash requires key"); 271 - return -1; 271 + return -EINVAL; 272 272 } 273 273 274 274 hash = (__u32)(combined_hash >> 32);