diff options
author | Jeff Layton <jlayton@kernel.org> | 2022-08-25 16:31:06 +0300 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2023-08-24 12:24:35 +0300 |
commit | 16be62fc8a53482529201b4be6bbcd0de3a058cb (patch) | |
tree | 08888b72ce3d9a13ae2a3f250fe3ead3a8a080e4 /fs/ceph/dir.c | |
parent | 14e034a61c908d4479be1a7ee9fe5b8d3d1f09b8 (diff) | |
download | linux-16be62fc8a53482529201b4be6bbcd0de3a058cb.tar.xz |
ceph: size handling in MClientRequest, cap updates and inode traces
For encrypted inodes, transmit a rounded-up size to the MDS as the
normal file size and send the real inode size in fscrypt_file field.
Also, fix up creates and truncates to also transmit fscrypt_file.
When we get an inode trace from the MDS, grab the fscrypt_file field if
the inode is encrypted, and use it to populate the i_size field instead
of the regular inode size field.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
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>
Diffstat (limited to 'fs/ceph/dir.c')
-rw-r--r-- | fs/ceph/dir.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index 08504afbe242..4990886a366c 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c @@ -915,6 +915,9 @@ static int ceph_mknod(struct mnt_idmap *idmap, struct inode *dir, goto out_req; } + if (S_ISREG(mode) && IS_ENCRYPTED(dir)) + set_bit(CEPH_MDS_R_FSCRYPT_FILE, &req->r_req_flags); + req->r_dentry = dget(dentry); req->r_num_caps = 2; req->r_parent = dir; |