From: Jeff Layton Date: Thu, 25 Aug 2022 13:31:18 +0000 (-0400) 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=a45172b8d2544c7285cfa6be33d4a5a9ae842139;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 64f8f668970f..bd5e04d994ac 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -2502,6 +2502,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 */