From: "Luís Henriques" <lhenriques@suse.de>
To: Jeff Layton <jlayton@kernel.org>
Cc: ceph-devel@vger.kernel.org, idryomov@gmail.com, xiubli@redhat.com
Subject: Re: [PATCH] ceph: shrink dcache when adding a key
Date: Mon, 28 Mar 2022 17:09:08 +0100 [thread overview]
Message-ID: <87r16mqct7.fsf@brahms.olymp> (raw)
In-Reply-To: <20220328133257.28422-1-jlayton@kernel.org> (Jeff Layton's message of "Mon, 28 Mar 2022 09:32:57 -0400")
Jeff Layton <jlayton@kernel.org> writes:
> Any extant dentries under a directory will be invalid once a key is
> added to the directory. Prune any child dentries of the parent after
> adding a key.
>
> Cc: Luís Henriques <lhenriques@suse.de>
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
> fs/ceph/ioctl.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> This one is for the ceph+fscrypt series.
>
> Luis, this seems to fix 580 and 593 for me. 595 still fails with it, but
> that one is more related to file contents.
>
> diff --git a/fs/ceph/ioctl.c b/fs/ceph/ioctl.c
> index 9675ef3a6c47..12d5469c5df2 100644
> --- a/fs/ceph/ioctl.c
> +++ b/fs/ceph/ioctl.c
> @@ -397,7 +397,10 @@ long ceph_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
> ret = vet_mds_for_fscrypt(file);
> if (ret)
> return ret;
> - return fscrypt_ioctl_add_key(file, (void __user *)arg);
> + ret = fscrypt_ioctl_add_key(file, (void __user *)arg);
> + if (ret == 0)
> + shrink_dcache_parent(file_dentry(file));
> + return ret;
OK, a problem with this is that we're using the big hammer: this ioctl is
being executed on the filesystem root and not the directory you're
expecting. This is because keys can used for more than one directory.
So, the performance penalty with this fix is probably not acceptable.
Cheers,
--
Luís
>
> case FS_IOC_REMOVE_ENCRYPTION_KEY:
> return fscrypt_ioctl_remove_key(file, (void __user *)arg);
> --
>
> 2.35.1
>
next prev parent reply other threads:[~2022-03-28 16:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-28 13:32 [PATCH] ceph: shrink dcache when adding a key Jeff Layton
2022-03-28 16:09 ` Luís Henriques [this message]
2022-03-28 16:24 ` 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=87r16mqct7.fsf@brahms.olymp \
--to=lhenriques@suse.de \
--cc=ceph-devel@vger.kernel.org \
--cc=idryomov@gmail.com \
--cc=jlayton@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.