linux/fs/crypto
Jeff Layton 637fa738b5 fscrypt: add fscrypt_context_for_new_inode
Most filesystems just call fscrypt_set_context on new inodes, which
usually causes a setxattr. That's a bit late for ceph, which can send
along a full set of attributes with the create request.

Doing so allows it to avoid race windows that where the new inode could
be seen by other clients without the crypto context attached. It also
avoids the separate round trip to the server.

Refactor the fscrypt code a bit to allow us to create a new crypto
context, attach it to the inode, and write it to the buffer, but without
calling set_context on it. ceph can later use this to marshal the
context into the attributes we send along with the create request.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Acked-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2022-08-03 00:54:11 +02:00
..
bio.c block: pass a block_device and opf to bio_reset 2022-02-02 07:50:00 -07:00
crypto.c fscrypt: split up FS_CRYPTO_BLOCK_SIZE 2022-04-13 15:03:09 -07:00
fname.c fscrypt: export fscrypt_fname_encrypt and fscrypt_fname_encrypted_size 2022-08-03 00:54:11 +02:00
fscrypt_private.h fscrypt: export fscrypt_fname_encrypt and fscrypt_fname_encrypted_size 2022-08-03 00:54:11 +02:00
hkdf.c fscrypt: allow 256-bit master keys with AES-256-XTS 2021-09-22 11:29:38 -07:00
hooks.c fscrypt: export fscrypt_fname_encrypt and fscrypt_fname_encrypted_size 2022-08-03 00:54:11 +02:00
inline_crypt.c fscrypt: log when starting to use inline encryption 2022-04-13 22:35:25 -07:00
Kconfig
keyring.c fscrypt: add new helper functions for test_dummy_encryption 2022-05-09 16:18:54 -07:00
keysetup.c fscrypt: factor out fscrypt_policy_to_key_spec() 2022-05-09 16:18:54 -07:00
keysetup_v1.c
Makefile
policy.c fscrypt: add fscrypt_context_for_new_inode 2022-08-03 00:54:11 +02:00