Skip to content
Commit 637fa738 authored by Jeff Layton's avatar Jeff Layton Committed by Ilya Dryomov
Browse files

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: default avatarJeff Layton <jlayton@kernel.org>
Reviewed-by: default avatarXiubo Li <xiubli@redhat.com>
Acked-by: default avatarEric Biggers <ebiggers@google.com>
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent d3e94fdc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment