From: Jeff Layton Date: Tue, 30 Nov 2021 18:38:42 +0000 (-0500) Subject: ceph: disable copy offload on encrypted inodes X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3d618cfc3c736e18797c093009f8fa69c1402542;p=ceph-client.git ceph: disable copy offload on encrypted inodes If we have an encrypted inode, then the client will need to re-encrypt the contents of the new object. Disable copy offload to or from encrypted inodes. Reviewed-by: Xiubo Li Signed-off-by: Jeff Layton --- diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 2ed7f184c0cf..cea442f71e7b 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -2541,6 +2541,10 @@ static ssize_t __ceph_copy_file_range(struct file *src_file, loff_t src_off, return -EOPNOTSUPP; } + /* Every encrypted inode gets its own key, so we can't offload them */ + if (IS_ENCRYPTED(src_inode) || IS_ENCRYPTED(dst_inode)) + return -EOPNOTSUPP; + if (len < src_ci->i_layout.object_size) return -EOPNOTSUPP; /* no remote copy will be done */