From: Jeff Layton <jlayton@kernel.org>
To: "Luís Henriques" <lhenriques@suse.de>,
"Xiubo Li" <xiubli@redhat.com>,
"Ilya Dryomov" <idryomov@gmail.com>
Cc: ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ceph: prevent snapshots to be created in encrypted locked directories
Date: Mon, 18 Apr 2022 09:17:14 -0400 [thread overview]
Message-ID: <0c5c361c6d65f5b2fdb1dc89fd4317f22cbc3e74.camel@kernel.org> (raw)
In-Reply-To: <20220418130839.9862-1-lhenriques@suse.de>
On Mon, 2022-04-18 at 14:08 +0100, Luís Henriques wrote:
> With snapshot names encryption we can not allow snapshots to be created in
> locked directories because the names wouldn't be encrypted. This patch
> forces the directory to be unlocked to allow a snapshot to be created.
>
> Signed-off-by: Luís Henriques <lhenriques@suse.de>
> ---
> fs/ceph/dir.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
> index f48f1ff20927..93e2f08102a1 100644
> --- a/fs/ceph/dir.c
> +++ b/fs/ceph/dir.c
> @@ -1071,6 +1071,10 @@ static int ceph_mkdir(struct user_namespace *mnt_userns, struct inode *dir,
> err = -EDQUOT;
> goto out;
> }
> + if ((op == CEPH_MDS_OP_MKSNAP) && !fscrypt_has_encryption_key(dir)) {
> + err = -ENOKEY;
> + goto out;
> + }
>
>
> req = ceph_mdsc_create_request(mdsc, op, USE_AUTH_MDS);
Looks good. I'll pull this and the v4 series into the wip-fscrypt later
todat.
--
Jeff Layton <jlayton@kernel.org>
next prev parent reply other threads:[~2022-04-18 14:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-14 13:51 [PATCH v4 0/4] ceph: add support for snapshot names encryption Luís Henriques
2022-04-14 13:51 ` [PATCH v4 1/4] ceph: add support for encrypted snapshot names Luís Henriques
2022-04-14 13:51 ` [PATCH v4 2/4] ceph: add support for handling " Luís Henriques
2022-04-18 12:45 ` Jeff Layton
2022-04-14 13:51 ` [PATCH v4 3/4] ceph: update documentation regarding snapshot naming limitations Luís Henriques
2022-04-14 13:51 ` [PATCH v4 4/4] ceph: replace base64url by the encoding used for mailbox names Luís Henriques
2022-04-18 2:08 ` [PATCH v4 0/4] ceph: add support for snapshot names encryption Xiubo Li
2022-04-18 13:08 ` [PATCH] ceph: prevent snapshots to be created in encrypted locked directories Luís Henriques
2022-04-18 13:17 ` Jeff Layton [this message]
2022-04-18 13:19 ` Jeff Layton
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=0c5c361c6d65f5b2fdb1dc89fd4317f22cbc3e74.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=ceph-devel@vger.kernel.org \
--cc=idryomov@gmail.com \
--cc=lhenriques@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=xiubli@redhat.com \
/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
Powered by JetHome