From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5B2EC433F5 for ; Thu, 31 Mar 2022 15:35:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239120AbiCaPhQ (ORCPT ); Thu, 31 Mar 2022 11:37:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238800AbiCaPf5 (ORCPT ); Thu, 31 Mar 2022 11:35:57 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFF16227C5A; Thu, 31 Mar 2022 08:32:15 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8524AB82187; Thu, 31 Mar 2022 15:32:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A467BC3410F; Thu, 31 Mar 2022 15:32:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648740734; bh=qAq3mL03dPPyz8rpkzUU759/4icEvNrrcE/+bmGFIFc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YKAKn//lcuNu6UuIdGS02F0jwJekXb8V9cwe6ATHUHuSdIIR682HeBLap1BVKck6e 1CkWJKVO4qL+wQzIJ6o/cE5BcIIOtzNtQtP2ui5hKNcaB/g6lfxtElXmx1PsGwUlBb tcZIQtAqWftBSLJqTwdAAfcIszcfooXEqHExnQsIfJl31b7e2VZp+9rka2xZ6FyuoG +HQfJYlAolpd+21HyVmdBUx0f57vpbo9A2WY8GaJLRNefaQCygd4gyCGDK7FOaXpm0 JkK3RZZISPRnKdXjTG0wtGIG+lJPps7T5prQ/dGa4TQ14YUWUFfM4iepEK/J3eMtlX kSUlYDYlqdkFA== From: Jeff Layton To: ceph-devel@vger.kernel.org Cc: xiubli@redhat.com, idryomov@gmail.com, lhenriques@suse.de, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v12 46/54] ceph: disable copy offload on encrypted inodes Date: Thu, 31 Mar 2022 11:31:22 -0400 Message-Id: <20220331153130.41287-47-jlayton@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220331153130.41287-1-jlayton@kernel.org> References: <20220331153130.41287-1-jlayton@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Jeff Layton --- fs/ceph/file.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/ceph/file.c b/fs/ceph/file.c index d8dfb8de4219..29cc65222ddd 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -2528,6 +2528,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 */ -- 2.35.1