]> git.apps.os.sepia.ceph.com Git - ceph-client.git/commit
ceph: fscrypt_auth handling for ceph
authorJeff Layton <jlayton@kernel.org>
Mon, 27 Jul 2020 14:16:09 +0000 (10:16 -0400)
committerXiubo Li <xiubli@redhat.com>
Thu, 18 Aug 2022 02:59:49 +0000 (10:59 +0800)
commit3300dc72617db46dbfe5ecdfb06e7a2cfedc480c
tree57d753dc2755fd04adde35db0f13136ed12d3fb9
parent34aed36cea4d087736e6a82862f12172c32b58e8
ceph: fscrypt_auth handling for ceph

Most fscrypt-enabled filesystems store the crypto context in an xattr,
but that's problematic for ceph as xatts are governed by the XATTR cap,
but we really want the crypto context as part of the AUTH cap.

Because of this, the MDS has added two new inode metadata fields:
fscrypt_auth and fscrypt_file. The former is used to hold the crypto
context, and the latter is used to track the real file size.

Parse new fscrypt_auth and fscrypt_file fields in inode traces. For now,
we don't use fscrypt_file, but fscrypt_auth is used to hold the fscrypt
context.

Allow the client to use a setattr request for setting the fscrypt_auth
field. Since this is not a standard setattr request from the VFS, we add
a new field to __ceph_setattr that carries ceph-specific inode attrs.

Have the set_context op do a setattr that sets the fscrypt_auth value,
and get_context just return the contents of that field (since it should
always be available).

Reviewed-by: Xiubo Li <xiubli@redhat.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
fs/ceph/Makefile
fs/ceph/acl.c
fs/ceph/crypto.c [new file with mode: 0644]
fs/ceph/crypto.h [new file with mode: 0644]
fs/ceph/inode.c
fs/ceph/mds_client.c
fs/ceph/mds_client.h
fs/ceph/super.c
fs/ceph/super.h
include/linux/ceph/ceph_fs.h