fscrypt: remove unnecessary calls to fscrypt_require_key()
authorEric Biggers <ebiggers@google.com>
Wed, 18 Nov 2020 07:56:09 +0000 (23:56 -0800)
committerEric Biggers <ebiggers@google.com>
Tue, 24 Nov 2020 23:10:27 +0000 (15:10 -0800)
commit234f1b7f8daf112655c87f75ae8932564f871225
tree50d6a76def3f3056ab97aa37208b0a95426897e9
parent76786a0f083473de31678bdb259a3d4167cf756d
fscrypt: remove unnecessary calls to fscrypt_require_key()

In an encrypted directory, a regular dentry (one that doesn't have the
no-key name flag) can only be created if the directory's encryption key
is available.

Therefore the calls to fscrypt_require_key() in __fscrypt_prepare_link()
and __fscrypt_prepare_rename() are unnecessary, as these functions
already check that the dentries they're given aren't no-key names.

Remove these unnecessary calls to fscrypt_require_key().

Link: https://lore.kernel.org/r/20201118075609.120337-6-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
fs/crypto/hooks.c
include/linux/fscrypt.h