All of lore.kernel.org
 help / color / mirror / Atom feed
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: add a has_stable_inodes operation for ceph
Date: Mon, 28 Mar 2022 15:29:40 +0100	[thread overview]
Message-ID: <87v8vyqhez.fsf@brahms.olymp> (raw)
In-Reply-To: <20220325184046.236663-1-jlayton@kernel.org> (Jeff Layton's message of "Fri, 25 Mar 2022 14:40:46 -0400")

Jeff Layton <jlayton@kernel.org> writes:

> ...and just have it return true. It should never change inode numbers
> out from under us, as they are baked into the object names.
>
> Reported-by: Luís Henriques <lhenriques@suse.de>
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
>  fs/ceph/crypto.c | 20 +++++++++++++-------
>  1 file changed, 13 insertions(+), 7 deletions(-)

Thanks, this looks good.  I've also tried it for a bit and seems work
fine.  Feel free to add my Reviewed-by (and Tested-by).

Cheers,
-- 
Luís

>
> diff --git a/fs/ceph/crypto.c b/fs/ceph/crypto.c
> index 2a8f95885e7d..3a9214b1e8b3 100644
> --- a/fs/ceph/crypto.c
> +++ b/fs/ceph/crypto.c
> @@ -59,6 +59,11 @@ static int ceph_crypt_set_context(struct inode *inode, const void *ctx, size_t l
>  	return ret;
>  }
>  
> +static const union fscrypt_policy *ceph_get_dummy_policy(struct super_block *sb)
> +{
> +	return ceph_sb_to_client(sb)->dummy_enc_policy.policy;
> +}
> +
>  static bool ceph_crypt_empty_dir(struct inode *inode)
>  {
>  	struct ceph_inode_info *ci = ceph_inode(inode);
> @@ -66,14 +71,9 @@ static bool ceph_crypt_empty_dir(struct inode *inode)
>  	return ci->i_rsubdirs + ci->i_rfiles == 1;
>  }
>  
> -void ceph_fscrypt_free_dummy_policy(struct ceph_fs_client *fsc)
> +static bool ceph_crypt_has_stable_inodes(struct super_block *sb)
>  {
> -	fscrypt_free_dummy_policy(&fsc->dummy_enc_policy);
> -}
> -
> -static const union fscrypt_policy *ceph_get_dummy_policy(struct super_block *sb)
> -{
> -	return ceph_sb_to_client(sb)->dummy_enc_policy.policy;
> +	return true;
>  }
>  
>  static struct fscrypt_operations ceph_fscrypt_ops = {
> @@ -82,6 +82,7 @@ static struct fscrypt_operations ceph_fscrypt_ops = {
>  	.set_context		= ceph_crypt_set_context,
>  	.get_dummy_policy	= ceph_get_dummy_policy,
>  	.empty_dir		= ceph_crypt_empty_dir,
> +	.has_stable_inodes	= ceph_crypt_has_stable_inodes,
>  };
>  
>  void ceph_fscrypt_set_ops(struct super_block *sb)
> @@ -89,6 +90,11 @@ void ceph_fscrypt_set_ops(struct super_block *sb)
>  	fscrypt_set_ops(sb, &ceph_fscrypt_ops);
>  }
>  
> +void ceph_fscrypt_free_dummy_policy(struct ceph_fs_client *fsc)
> +{
> +	fscrypt_free_dummy_policy(&fsc->dummy_enc_policy);
> +}
> +
>  int ceph_fscrypt_prepare_context(struct inode *dir, struct inode *inode,
>  				 struct ceph_acl_sec_ctx *as)
>  {
> -- 
>
> 2.35.1
>

      reply	other threads:[~2022-03-28 14:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-25 18:40 [PATCH] ceph: add a has_stable_inodes operation for ceph Jeff Layton
2022-03-28 14:29 ` Luís Henriques [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=87v8vyqhez.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.