diff options
author | Luís Henriques <lhenriques@suse.de> | 2022-11-29 11:39:49 +0100 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2023-08-24 11:24:35 +0200 |
commit | 14e034a61c908d4479be1a7ee9fe5b8d3d1f09b8 (patch) | |
tree | 5a8a46cbfaed77a5df049eb2036c1aaa58acf2bc /fs/ceph/mds_client.c | |
parent | ceph: allow encrypting a directory while not having Ax caps (diff) | |
download | linux-14e034a61c908d4479be1a7ee9fe5b8d3d1f09b8.tar.xz linux-14e034a61c908d4479be1a7ee9fe5b8d3d1f09b8.zip |
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/mds_client.c')
-rw-r--r-- | fs/ceph/mds_client.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index 447acc4a0fbd..7de22052ee22 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c @@ -2545,8 +2545,8 @@ static u8 *get_fscrypt_altname(const struct ceph_mds_request *req, u32 *plen) if (!IS_ENCRYPTED(dir)) goto success; - ret = __fscrypt_prepare_readdir(dir); - if (ret) + ret = ceph_fscrypt_prepare_readdir(dir); + if (ret < 0) return ERR_PTR(ret); /* No key? Just ignore it. */ @@ -2666,7 +2666,7 @@ retry: spin_unlock(&cur->d_lock); parent = dget_parent(cur); - ret = __fscrypt_prepare_readdir(d_inode(parent)); + ret = ceph_fscrypt_prepare_readdir(d_inode(parent)); if (ret < 0) { dput(parent); dput(cur); |