All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Venky Shankar <vshankar@redhat.com>, idryomov@gmail.com
Cc: xiubli@redhat.com, ceph-devel@vger.kernel.org
Subject: Re: [PATCH] ceph: allow `ceph.dir.rctime' xattr to be updatable
Date: Fri, 11 Mar 2022 10:16:17 -0500	[thread overview]
Message-ID: <12877268cdbd9fabfec0ee40e8684467984e15f5.camel@kernel.org> (raw)
In-Reply-To: <20220310143419.14284-1-vshankar@redhat.com>

On Thu, 2022-03-10 at 09:34 -0500, Venky Shankar wrote:
> `rctime' has been a pain point in cephfs due to its buggy
> nature - inconsistent values reported and those sorts.
> Fixing rctime is non-trivial needing an overall redesign
> of the entire nested statistics infrastructure.
> 
> As a workaround, PR
> 
>      http://github.com/ceph/ceph/pull/37938
> 
> allows this extended attribute to be manually set. This allows
> users to "fixup" inconsistency rctime values. While this sounds
> messy, its probably the wisest approach allowing users/scripts
> to workaround buggy rctime values.
> 
> The above PR enables Ceph MDS to allow manually setting
> rctime extended attribute with the corresponding user-land
> changes. We may as well allow the same to be done via kclient
> for parity.
> 
> Signed-off-by: Venky Shankar <vshankar@redhat.com>
> ---
>  fs/ceph/xattr.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/ceph/xattr.c b/fs/ceph/xattr.c
> index afec84088471..8c2dc2c762a4 100644
> --- a/fs/ceph/xattr.c
> +++ b/fs/ceph/xattr.c
> @@ -366,6 +366,14 @@ static ssize_t ceph_vxattrcb_auth_mds(struct ceph_inode_info *ci,
>  	}
>  #define XATTR_RSTAT_FIELD(_type, _name)			\
>  	XATTR_NAME_CEPH(_type, _name, VXATTR_FLAG_RSTAT)
> +#define XATTR_RSTAT_FIELD_UPDATABLE(_type, _name)			\
> +	{								\
> +		.name = CEPH_XATTR_NAME(_type, _name),			\
> +		.name_size = sizeof (CEPH_XATTR_NAME(_type, _name)),	\
> +		.getxattr_cb = ceph_vxattrcb_ ## _type ## _ ## _name,	\
> +		.exists_cb = NULL,					\
> +		.flags = VXATTR_FLAG_RSTAT,				\
> +	}
>  #define XATTR_LAYOUT_FIELD(_type, _name, _field)			\
>  	{								\
>  		.name = CEPH_XATTR_NAME2(_type, _name, _field),	\
> @@ -404,7 +412,7 @@ static struct ceph_vxattr ceph_dir_vxattrs[] = {
>  	XATTR_RSTAT_FIELD(dir, rsubdirs),
>  	XATTR_RSTAT_FIELD(dir, rsnaps),
>  	XATTR_RSTAT_FIELD(dir, rbytes),
> -	XATTR_RSTAT_FIELD(dir, rctime),
> +	XATTR_RSTAT_FIELD_UPDATABLE(dir, rctime),
>  	{
>  		.name = "ceph.dir.pin",
>  		.name_size = sizeof("ceph.dir.pin"),

Thanks Venky, looks good. Merged into testing branch.
-- 
Jeff Layton <jlayton@kernel.org>

      parent reply	other threads:[~2022-03-11 15:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-10 14:34 [PATCH] ceph: allow `ceph.dir.rctime' xattr to be updatable Venky Shankar
2022-03-11  8:59 ` Xiubo Li
2022-03-11 15:16 ` Jeff Layton [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=12877268cdbd9fabfec0ee40e8684467984e15f5.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=ceph-devel@vger.kernel.org \
    --cc=idryomov@gmail.com \
    --cc=vshankar@redhat.com \
    --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.