ceph: add support to readdir for encrypted names
To make it simpler to decrypt names in a readdir reply (i.e. before we have a dentry), add a new ceph_encode_encrypted_fname()-like helper that takes a qstr pointer instead of a dentry pointer. Once we've decrypted the names in a readdir reply, we no longer need the crypttext, so overwrite them in ceph_mds_reply_dir_entry with the unencrypted names. Then in both ceph_readdir_prepopulate() and ceph_readdir() we will use the dencrypted name directly. [ jlayton: convert some BUG_ONs into error returns ] Signed-off-by:Xiubo Li <xiubli@redhat.com> Reviewed-by:
Jeff Layton <jlayton@kernel.org> 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>
Showing
- fs/ceph/crypto.c 20 additions, 7 deletionsfs/ceph/crypto.c
- fs/ceph/crypto.h 10 additions, 0 deletionsfs/ceph/crypto.h
- fs/ceph/dir.c 30 additions, 6 deletionsfs/ceph/dir.c
- fs/ceph/inode.c 8 additions, 4 deletionsfs/ceph/inode.c
- fs/ceph/mds_client.c 74 additions, 7 deletionsfs/ceph/mds_client.c
- fs/ceph/mds_client.h 2 additions, 2 deletionsfs/ceph/mds_client.h
Please register or sign in to comment