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>
This commit is contained in:
Julian Sun 2025-10-10 17:52:57 +08:00 committed by Theodore Ts'o
parent 6146a0f1df
commit ce3236a3c7
1 changed files with 1 additions and 1 deletions

View File

@ -268,7 +268,7 @@ static int __ext4fs_dirhash(const struct inode *dir, const char *name, int len,
combined_hash = fscrypt_fname_siphash(dir, &qname);
} else {
ext4_warning_inode(dir, "Siphash requires key");
return -1;
return -EINVAL;
}
hash = (__u32)(combined_hash >> 32);