summaryrefslogtreecommitdiffstats
path: root/fs/ceph/mds_client.h
diff options
context:
space:
mode:
authorJeff Layton <jlayton@kernel.org>2021-01-11 12:35:48 -0500
committerIlya Dryomov <idryomov@gmail.com>2023-08-24 11:24:34 +0200
commit4ac4c23eaa389859f746a6ef31e1c71d880312f4 (patch)
tree55df2631c8a337942744251fb071c13bd6984360 /fs/ceph/mds_client.h
parent24865e75c1a4e70ac9e8328dae8b5e03712a6e8c (diff)
downloadlinux-4ac4c23eaa389859f746a6ef31e1c71d880312f4.tar.gz
linux-4ac4c23eaa389859f746a6ef31e1c71d880312f4.tar.bz2
linux-4ac4c23eaa389859f746a6ef31e1c71d880312f4.zip
ceph: decode alternate_name in lease info
Ceph is a bit different from local filesystems, in that we don't want to store filenames as raw binary data, since we may also be dealing with clients that don't support fscrypt. We could just base64-encode the encrypted filenames, but that could leave us with filenames longer than NAME_MAX. It turns out that the MDS doesn't care much about filename length, but the clients do. To manage this, we've added a new "alternate name" field that can be optionally added to any dentry that we'll use to store the binary crypttext of the filename if its base64-encoded value will be longer than NAME_MAX. When a dentry has one of these names attached, the MDS will send it along in the lease info, which we can then store for later usage. Signed-off-by: Jeff Layton <jlayton@kernel.org> Reviewed-by: Xiubo Li <xiubli@redhat.com> Reviewed-and-tested-by: Luís Henriques <lhenriques@suse.de> Reviewed-by: Milind Changire <mchangir@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/mds_client.h')
-rw-r--r--fs/ceph/mds_client.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/ceph/mds_client.h b/fs/ceph/mds_client.h
index 3cf874925519..a4a6f7893b9e 100644
--- a/fs/ceph/mds_client.h
+++ b/fs/ceph/mds_client.h
@@ -44,6 +44,7 @@ enum ceph_feature_type {
CEPHFS_FEATURE_MULTI_RECONNECT, \
CEPHFS_FEATURE_DELEG_INO, \
CEPHFS_FEATURE_METRIC_COLLECT, \
+ CEPHFS_FEATURE_ALTERNATE_NAME, \
CEPHFS_FEATURE_NOTIFY_SESSION_STATE, \
CEPHFS_FEATURE_OP_GETVXATTR, \
}
@@ -96,7 +97,9 @@ struct ceph_mds_reply_info_in {
struct ceph_mds_reply_dir_entry {
char *name;
+ u8 *altname;
u32 name_len;
+ u32 altname_len;
struct ceph_mds_reply_lease *lease;
struct ceph_mds_reply_info_in inode;
loff_t offset;
@@ -120,7 +123,9 @@ struct ceph_mds_reply_info_parsed {
struct ceph_mds_reply_info_in diri, targeti;
struct ceph_mds_reply_dirfrag *dirfrag;
char *dname;
+ u8 *altname;
u32 dname_len;
+ u32 altname_len;
struct ceph_mds_reply_lease *dlease;
struct ceph_mds_reply_xattr xattr_info;