summaryrefslogtreecommitdiff
path: root/fs/ceph/crypto.h
diff options
context:
space:
mode:
authorLuís Henriques <lhenriques@suse.de>2022-11-29 13:39:49 +0300
committerIlya Dryomov <idryomov@gmail.com>2023-08-24 12:24:35 +0300
commit14e034a61c908d4479be1a7ee9fe5b8d3d1f09b8 (patch)
tree5a8a46cbfaed77a5df049eb2036c1aaa58acf2bc /fs/ceph/crypto.h
parente127e03009a3a3c26f00d0b2703c6e0e47927aec (diff)
downloadlinux-14e034a61c908d4479be1a7ee9fe5b8d3d1f09b8.tar.xz
ceph: mark directory as non-complete after loading key
When setting a directory's crypt context, ceph_dir_clear_complete() needs to be called otherwise if it was complete before, any existing (old) dentry will still be valid. This patch adds a wrapper around __fscrypt_prepare_readdir() which will ensure a directory is marked as non-complete if key status changes. [ xiubli: revise commit title per Milind ] Signed-off-by: Luís Henriques <lhenriques@suse.de> Reviewed-by: Xiubo Li <xiubli@redhat.com> Reviewed-by: Milind Changire <mchangir@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/crypto.h')
-rw-r--r--fs/ceph/crypto.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/ceph/crypto.h b/fs/ceph/crypto.h
index 21694df7dfbf..b5413ec95b1a 100644
--- a/fs/ceph/crypto.h
+++ b/fs/ceph/crypto.h
@@ -103,6 +103,7 @@ static inline void ceph_fname_free_buffer(struct inode *parent,
int ceph_fname_to_usr(const struct ceph_fname *fname, struct fscrypt_str *tname,
struct fscrypt_str *oname, bool *is_nokey);
+int ceph_fscrypt_prepare_readdir(struct inode *dir);
#else /* CONFIG_FS_ENCRYPTION */
@@ -160,6 +161,11 @@ static inline int ceph_fname_to_usr(const struct ceph_fname *fname,
oname->len = fname->name_len;
return 0;
}
+
+static inline int ceph_fscrypt_prepare_readdir(struct inode *dir)
+{
+ return 0;
+}
#endif /* CONFIG_FS_ENCRYPTION */
#endif