From patchwork Wed Mar 2 12:13:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiubo Li X-Patchwork-Id: 12765888 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 B88CAC433F5 for ; Wed, 2 Mar 2022 12:13:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241681AbiCBMOT (ORCPT ); Wed, 2 Mar 2022 07:14:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238422AbiCBMOR (ORCPT ); Wed, 2 Mar 2022 07:14:17 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BB0F62E0A2 for ; Wed, 2 Mar 2022 04:13:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646223212; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=tsoaNwkou12yJtcbdHygEC2cON+tUkKOd0eAvQbTM8Y=; b=h1piht5ADa9kurqOBLZy9wLf//VVCo3+Qmolxok3m0gVkyfh9o6i0SLc2kWVBF5eRhsmrT FC+YcwwMkuBb+uIfCNXt7VD5hx7X2/3uYOUirJHJSiUzF6zrqrGHFsn27tcZG2hU3+IVlT U5owdJsRFvZQpyVBjU3CQIe+6C9HkaI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-322-gWdGzFAUOve4K0g8Ui89jA-1; Wed, 02 Mar 2022 07:13:31 -0500 X-MC-Unique: gWdGzFAUOve4K0g8Ui89jA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8C348835DE1; Wed, 2 Mar 2022 12:13:30 +0000 (UTC) Received: from lxbceph1.gsslab.pek2.redhat.com (unknown [10.72.47.117]) by smtp.corp.redhat.com (Postfix) with ESMTP id C6071781F1; Wed, 2 Mar 2022 12:13:28 +0000 (UTC) From: xiubli@redhat.com To: jlayton@kernel.org Cc: idryomov@gmail.com, vshankar@redhat.com, ceph-devel@vger.kernel.org, Xiubo Li Subject: [PATCH v3 0/6] ceph: encrypt the snapshot directories Date: Wed, 2 Mar 2022 20:13:17 +0800 Message-Id: <20220302121323.240432-1-xiubli@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org From: Xiubo Li This patch series is base on the 'wip-fscrypt' branch in ceph-client. V3: - Add more detail comments in the commit comments and code comments. - Fix some bugs. - Improved the patches. - Remove the already merged patch. V2: - Fix several bugs, such as for the long snap name encrypt/dencrypt - Skip double dencypting dentry names for readdir ====== NOTE: This patch series won't fix the long snap shot issue as Luis is working on that. Xiubo Li (6): ceph: fail the request when failing to decode dentry names ceph: do not dencrypt the dentry name twice for readdir ceph: add ceph_get_snap_parent_inode() support ceph: use the parent inode of '.snap' to dencrypt the names for readdir ceph: use the parent inode of '.snap' to encrypt name to build path ceph: try to encrypt/decrypt long snap name fs/ceph/crypto.c | 95 ++++++++++++++++++++++++++++++++--- fs/ceph/crypto.h | 10 +++- fs/ceph/dir.c | 98 ++++++++++++++++++++++-------------- fs/ceph/inode.c | 115 ++++++++++++++++++++++++++++++++++++++----- fs/ceph/mds_client.c | 57 +++++++++++++-------- fs/ceph/mds_client.h | 3 ++ fs/ceph/snap.c | 24 +++++++++ fs/ceph/super.h | 2 + 8 files changed, 327 insertions(+), 77 deletions(-)