ceph: add more comments about the CEPH_NOHASH_NAME_MAX
PATCH 1/1 ceph: add more comments about the CEPH_NOHASH_NAME_MAX
From: Xiubo Li <[email protected]>
We should make it clear where the 189 comes from and why, I almost forgot why we discard the dirhash[2] in ceph, which we discussed it months ago.
Signed-off-by Xiubo Li <[email protected]>
---
Jeff, you can sqush this into prvious commit too.
fs/ceph/crypto.c | 2 +- fs/ceph/crypto.h | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-)
fs/ceph/crypto.c +1 -1
@@ -142,7 +142,7 @@ int ceph_encode_encrypted_dname(const struct inode *parent, struct qstr *d_name,/* * convert cleartext d_name to ciphertext -* if result is longer than CEPH_NOKEY_NAME_MAX, +* if result is longer than CEPH_NOHASH_NAME_MAX, * sha256 the remaining bytes * * See: fscrypt_setup_filename
fs/ceph/crypto.h +7 -1
@@ -76,7 +76,13 @@ static inline u32 ceph_fscrypt_auth_len(struct ceph_fscrypt_auth *fa)* smaller size. If the ciphertext name is longer than the value below, then * sha256 hash the remaining bytes. * -* 189 bytes => 252 bytes base64-encoded, which is <= NAME_MAX (255) +* For the fscrypt_nokey_name struct the dirhash[2] member is useless in ceph +* so the corresponding struct will be: +* +* struct fscrypt_ceph_nokey_name { +* u8 bytes[157]; +* u8 sha256[SHA256_DIGEST_SIZE]; +* }; // 189 bytes => 252 bytes base64-encoded, which is <= NAME_MAX (255) * * Note that for long names that end up having their tail portion hashed, we * must also store the full encrypted name (in the dentry's alternate_name
Signature · 1 line
2.27.0