On 3/15/22 2:38 AM, Jeff Layton wrote:
On Mon, 2022-03-14 at 10:28 +0800, xiubli@xxxxxxxxxx wrote:
From: Xiubo Li <xiubli@xxxxxxxxxx>
This is a new approach to improve the readdir and based the previous
discussion in another thread:
https://patchwork.kernel.org/project/ceph-devel/list/?series=621901
Just start a new thread for this.
As Jeff suggested, this patch series will dentrypt the dentry name
during parsing the readdir data in handle_reply(). And then in both
ceph_readdir_prepopulate() and ceph_readdir() we will use the
dencrypted name directly.
NOTE: we will base64_dencode and dencrypt the names in-place instead
of allocating tmp buffers. For base64_dencode it's safe because the
dencoded string buffer will always be shorter.
V2:
- Fix the WARN issue reported by Luis, thanks.
Xiubo Li (4):
ceph: pass the request to parse_reply_info_readdir()
ceph: add ceph_encode_encrypted_dname() helper
ceph: dencrypt the dentry names early and once for readdir
ceph: clean up the ceph_readdir() code
fs/ceph/crypto.c | 25 ++++++++---
fs/ceph/crypto.h | 2 +
fs/ceph/dir.c | 64 +++++++++------------------
fs/ceph/inode.c | 37 ++--------------
fs/ceph/mds_client.c | 101 ++++++++++++++++++++++++++++++++++++-------
fs/ceph/mds_client.h | 4 +-
6 files changed, 133 insertions(+), 100 deletions(-)
This looks good, Xiubo. I did some testing with these earlier and they
seemed to work great.
I've gone ahead and merged these into the wip-fscrypt branch. It may be
best to eventually squash these down, but it's probably fine to leave
them on top as well.
Sure Jeff, thanks.
- Xiubo
Thanks!