Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1231225pxp; Thu, 17 Mar 2022 05:47:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyizl5gNMK9rZElfR2gKyEXm3ygbHQrKFsqTfQ0v/kXvkumvLMTkhOe5GKkiuUQ5QA3WRse X-Received: by 2002:a17:907:a40e:b0:6dd:999:d7df with SMTP id sg14-20020a170907a40e00b006dd0999d7dfmr4315234ejc.494.1647521237743; Thu, 17 Mar 2022 05:47:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647521237; cv=none; d=google.com; s=arc-20160816; b=mYbKxZi7uwK8zQtUjlknVZoeD2QMAbuiWDdJ6OMzUTMeB7xGYzKFaMTXfZ95iFEg9R sLBy+v4UfDQtrT3nTTF9uIkBK5ZDjurf0K5ngTAwfchh4UfTiMfE5G0Tga77f0CjXR2v /vLwPRQvaiZXAmmjmyUYt1vUG0iVRs576y2ugeQfir1YytVx9CTNI2Y6A0lkR+sA/Xup uRob8KM+I+/YzkvWkf7C2qHe2onLGtHI4F8v7jNg612ERSEtuWuIUdg2qfUudbAVAa3h Vcwuyr7AMx7Nbf+6PbEAMRx3f9NOp69dzzKyYjHK87bKyzXaRNQwgDum+cwthCa34Qz2 204Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:in-reply-to:date:references:subject:cc:to:from :dkim-signature:dkim-signature; bh=EkHzWOqcfA+EWvx9G34ymicMu1mMDdlE+2xRd+Bpe3Y=; b=cefm86RmB4LggcGgKpMoSsILy8wcfINL8ln1MM+5Akv17oQVRAv56lRotrelNERc2h i78T21WWXw7DrQS5O0mY+5OR/MD+gIJwqHWptNNyEgwsroFtqZQxblOFi01c5FtaPNa0 plJNeDuzT5mLrqERU0l8Vdt5D3J/VRVxrtA7g5X6Y7EotlRWrMu3iIlpwJkaa4OiSO5D 689SlQMItGqqtnUo8ZVIW+qNUbc81yhupyeQck/Af00jiM/3bLNOSDC504xJUiu5qRoe I19kd6tgIUSoN7ydmo5XV/sadOziah3IIbqEK6sWfAr6xdbnOOKqQRgpG8pdKQV7I39P 2UPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=MgsTYbL3; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k1-20020a170906680100b006cfd2d1105fsi2847561ejr.531.2022.03.17.05.46.52; Thu, 17 Mar 2022 05:47:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=MgsTYbL3; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232505AbiCQKQB (ORCPT + 99 others); Thu, 17 Mar 2022 06:16:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232517AbiCQKP7 (ORCPT ); Thu, 17 Mar 2022 06:15:59 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E90501DEA84; Thu, 17 Mar 2022 03:14:40 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id A71331F38D; Thu, 17 Mar 2022 10:14:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1647512079; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EkHzWOqcfA+EWvx9G34ymicMu1mMDdlE+2xRd+Bpe3Y=; b=MgsTYbL3M8BjxDf5Pfv5izxmYt0KoJoZXvJYfbE0NhkpzvA2SdRn4OvT98c7M5ybrk8s3c nJHYhF9wGs8DjFfSGLWQU9bbyIX1Efmxe3Xygwv+QJPMDMhOld9L963N3zilu946fx1oYd GyWwjH6TroPx0ruEvbdlwLRE4uNZ/GU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1647512079; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EkHzWOqcfA+EWvx9G34ymicMu1mMDdlE+2xRd+Bpe3Y=; b=6sNI6ikjHIbqqUSbSQj+pf0+tVN12oDSMIrVFr3AnE02+v4ksRcZOJQnY58iv/RssQ6qJ5 gOGTHWxPLIzBDVBQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 4299F13B4B; Thu, 17 Mar 2022 10:14:39 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id BQRlDQ8KM2KvNgAAMHmgww (envelope-from ); Thu, 17 Mar 2022 10:14:39 +0000 Received: from localhost (brahms.olymp [local]) by brahms.olymp (OpenSMTPD) with ESMTPA id 49333f2e; Thu, 17 Mar 2022 10:14:58 +0000 (UTC) From: =?utf-8?Q?Lu=C3=ADs_Henriques?= To: Xiubo Li Cc: Jeff Layton , Ilya Dryomov , Ceph Development , linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH v2 0/3] ceph: add support for snapshot names encryption References: <20220315161959.19453-1-lhenriques@suse.de> <5b53e812-d49b-45f0-1219-3dbc96febbc1@redhat.com> Date: Thu, 17 Mar 2022 10:14:58 +0000 In-Reply-To: <5b53e812-d49b-45f0-1219-3dbc96febbc1@redhat.com> (Xiubo Li's message of "Thu, 17 Mar 2022 13:27:01 +0800") Message-ID: <87bky4j36l.fsf@brahms.olymp> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Xiubo Li writes: > Hi Luis, > > There has another issue you need to handle at the same time. > > Currently only the empty directory could be enabled the file encryption, = such as > for the following command: > > $ fscrypt encrypt mydir/ > > But should we also make sure that the mydir/.snap/ is empty ? > > Here the 'empty' is not totally empty, which allows it should allow long = snap > names exist. > > Make sense ? Right, actually I had came across that question in the past but completely forgot about it. Right now we simply check the dir stats to ensure a directory is empty. We could add an extra check in ceph_crypt_empty_dir() to ensure that there are no snapshots _above_ that directory (i.e. that there are no "mydir/.snap/_name_xxxxx"). Unfortunately, I don't know enough of snapshots implementation details to understand if it's a problem to consider a directory as being empty (in the fscrypt context) when there are these '_name_xxx' directories. My feeling is that this is not a problem but I really don't know. Do you (or anyone) have any ideas/suggestions? Cheers, --=20 Lu=C3=ADs > > - Xiubo > > > On 3/16/22 12:19 AM, Lu=C3=ADs Henriques wrote: >> Hi! >> >> A couple of changes since v1: >> >> - Dropped the dentry->d_flags change in ceph_mkdir(). Thanks to Xiubo >> suggestion, patch 0001 now skips calling ceph_fscrypt_prepare_context= () >> if we're handling a snapshot. >> >> - Added error handling to ceph_get_snapdir() in patch 0001 (Jeff had >> already pointed that out but I forgot to include that change in previ= ous >> revision). >> >> - Rebased patch 0002 to the latest wip-fscrypt branch. >> >> - Added some documentation regarding snapshots naming restrictions. >> >> As before, in order to test this code the following PRs are required: >> >> mds: add protection from clients without fscrypt support #45073 >> mds: use the whole string as the snapshot long name #45192 >> mds: support alternate names for snapshots #45224 >> mds: limit the snapshot names to 240 characters #45312 >> >> Lu=C3=ADs Henriques (3): >> ceph: add support for encrypted snapshot names >> ceph: add support for handling encrypted snapshot names >> ceph: update documentation regarding snapshot naming limitations >> >> Documentation/filesystems/ceph.rst | 10 ++ >> fs/ceph/crypto.c | 158 +++++++++++++++++++++++++---- >> fs/ceph/crypto.h | 11 +- >> fs/ceph/inode.c | 31 +++++- >> 4 files changed, 182 insertions(+), 28 deletions(-) >> >