]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commit
ceph: decode alternate_name in lease info
authorJeff Layton <jlayton@kernel.org>
Mon, 11 Jan 2021 17:35:48 +0000 (12:35 -0500)
committerJeff Layton <jlayton@kernel.org>
Tue, 7 Dec 2021 15:32:47 +0000 (10:32 -0500)
commit44e7d03b5fe0e1b634681276c628a2e8b17afa61
tree5fce870e548a12e7293561526dae9f25f4633c85
parent65b703eb7d75cf515909afbb87fe123c0b61b166
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>
fs/ceph/mds_client.c
fs/ceph/mds_client.h