]> 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>
Tue, 30 Nov 2021 18:38:42 +0000 (13:38 -0500)
committerJeff Layton <jlayton@kernel.org>
Tue, 31 May 2022 15:50:01 +0000 (11:50 -0400)
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 2ed7f184c0cf2c0c5f9b192df3c5971f5ae8a9d1..cea442f71e7bca44b0a2386cf600f52f9d5ca471 100644 (file)
@@ -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 */