mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Xiubo Li <xiubli@redhat.com>
To: "Luís Henriques" <lhenriques@suse.de>
Cc: Jeff Layton <jlayton@kernel.org>,
	Ilya Dryomov <idryomov@gmail.com>,
	Ceph Development <ceph-devel@vger.kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH v2 0/3] ceph: add support for snapshot names encryption
Date: Thu, 17 Mar 2022 19:22:47 +0800	[thread overview]
Message-ID: <d813d2d3-2493-59b1-9a68-8dd533e83452@redhat.com> (raw)
In-Reply-To: <87bky4j36l.fsf@brahms.olymp>


On 3/17/22 6:14 PM, Luís Henriques wrote:
> Xiubo Li <xiubli@redhat.com> 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").

Check this only in ceph_crypt_empty_dir() seems not enough, at least not 
graceful.

Please see 
https://github.com/google/fscrypt/blob/master/cmd/fscrypt/commands.go#L305.

The google/fscrypt will read that directory to check where it's empty or 
not. So eventually we may need to fix it there. But for a workaround you 
may could fix it in ceph_crypt_empty_dir() and ceph_ioctl() when setting 
the key or policy ?

-- Xiubo


>
> 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,


      parent reply	other threads:[~2022-03-17 11:23 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-15 16:19 Luís Henriques
2022-03-15 16:19 ` [RFC PATCH v2 1/3] ceph: add support for encrypted snapshot names Luís Henriques
2022-03-16  0:07   ` Xiubo Li
2022-03-15 16:19 ` [RFC PATCH v2 2/3] ceph: add support for handling " Luís Henriques
2022-03-16  0:47   ` Xiubo Li
2022-03-16 11:00     ` Luís Henriques
2022-03-15 16:19 ` [RFC PATCH v2 3/3] ceph: update documentation regarding snapshot naming limitations Luís Henriques
2022-03-16  0:48   ` Xiubo Li
2022-03-17  5:27 ` [RFC PATCH v2 0/3] ceph: add support for snapshot names encryption Xiubo Li
2022-03-17 10:01   ` Jeff Layton
2022-03-17 10:52     ` Xiubo Li
2022-03-17 11:11       ` Luís Henriques
2022-03-17 11:28         ` Xiubo Li
2022-03-17 12:01         ` Jeff Layton
2022-03-17 12:31           ` Xiubo Li
2022-03-17 12:41             ` Jeff Layton
2022-03-17 12:44               ` Xiubo Li
2022-03-17 15:59           ` Luís Henriques
2022-03-17 10:14   ` Luís Henriques
2022-03-17 11:02     ` Xiubo Li
2022-03-17 11:22     ` Xiubo Li [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d813d2d3-2493-59b1-9a68-8dd533e83452@redhat.com \
    --to=xiubli@redhat.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=idryomov@gmail.com \
    --cc=jlayton@kernel.org \
    --cc=lhenriques@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®