Skip to content

Commit d7a2dc5

Browse files
vshankaridryomov
authored andcommitted
ceph: allow ceph.dir.rctime xattr to be updatable
`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" inconsistent 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 <[email protected]> Reviewed-by: Xiubo Li <[email protected]> Signed-off-by: Ilya Dryomov <[email protected]>
1 parent 4b0986a commit d7a2dc5

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

fs/ceph/xattr.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,14 @@ static ssize_t ceph_vxattrcb_auth_mds(struct ceph_inode_info *ci,
366366
}
367367
#define XATTR_RSTAT_FIELD(_type, _name) \
368368
XATTR_NAME_CEPH(_type, _name, VXATTR_FLAG_RSTAT)
369+
#define XATTR_RSTAT_FIELD_UPDATABLE(_type, _name) \
370+
{ \
371+
.name = CEPH_XATTR_NAME(_type, _name), \
372+
.name_size = sizeof (CEPH_XATTR_NAME(_type, _name)), \
373+
.getxattr_cb = ceph_vxattrcb_ ## _type ## _ ## _name, \
374+
.exists_cb = NULL, \
375+
.flags = VXATTR_FLAG_RSTAT, \
376+
}
369377
#define XATTR_LAYOUT_FIELD(_type, _name, _field) \
370378
{ \
371379
.name = CEPH_XATTR_NAME2(_type, _name, _field), \
@@ -404,7 +412,7 @@ static struct ceph_vxattr ceph_dir_vxattrs[] = {
404412
XATTR_RSTAT_FIELD(dir, rsubdirs),
405413
XATTR_RSTAT_FIELD(dir, rsnaps),
406414
XATTR_RSTAT_FIELD(dir, rbytes),
407-
XATTR_RSTAT_FIELD(dir, rctime),
415+
XATTR_RSTAT_FIELD_UPDATABLE(dir, rctime),
408416
{
409417
.name = "ceph.dir.pin",
410418
.name_size = sizeof("ceph.dir.pin"),

0 commit comments

Comments
 (0)