]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commitdiff
ceph: disable copy offload on encrypted inodes
authorJeff Layton <jlayton@kernel.org>
Thu, 25 Aug 2022 13:31:18 +0000 (09:31 -0400)
committerXiubo Li <xiubli@redhat.com>
Fri, 26 Aug 2022 23:58:56 +0000 (07:58 +0800)
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 <xiubli@redhat.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
fs/ceph/file.c

index 64f8f668970fefd7b8f33ba078a883cedcfb33ef..bd5e04d994ac2e88f219521c6e32d819f18bb0a6 100644 (file)
@@ -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 */