From 304640e55c0f3c6d15f4e230dc6376e4f5020fea Mon Sep 17 00:00:00 2001 From: Kotresh HR Date: Mon, 29 Jul 2019 18:30:42 +0530 Subject: ctime/rebalance: Heal ctime xattr on directory during rebalance After add-brick and rebalance, the ctime xattr is not present on rebalanced directories on new brick. This patch fixes the same. Note that ctime still doesn't support consistent time across distribute sub-volume. This patch also fixes the in-memory inconsistency of time attributes when metadata is self healed. Change-Id: Ia20506f1839021bf61d4753191e7dc34b31bb2df fixes: bz#1734026 Signed-off-by: Kotresh HR --- xlators/cluster/afr/src/afr-self-heal-common.c | 3 ++- xlators/cluster/dht/src/dht-common.c | 1 + xlators/cluster/ec/src/ec-heal.c | 7 ++++--- 3 files changed, 7 insertions(+), 4 deletions(-) (limited to 'xlators/cluster') diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c index b0da6479769..f06f7e603a0 100644 --- a/xlators/cluster/afr/src/afr-self-heal-common.c +++ b/xlators/cluster/afr/src/afr-self-heal-common.c @@ -513,7 +513,8 @@ afr_selfheal_restore_time(call_frame_t *frame, xlator_t *this, inode_t *inode, AFR_ONLIST(healed_sinks, frame, afr_sh_generic_fop_cbk, setattr, &loc, &replies[source].poststat, - (GF_SET_ATTR_ATIME | GF_SET_ATTR_MTIME), NULL); + (GF_SET_ATTR_ATIME | GF_SET_ATTR_MTIME | GF_SET_ATTR_CTIME), + NULL); loc_wipe(&loc); diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index 04abe008e17..232685bd56d 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -113,6 +113,7 @@ char *xattrs_to_heal[] = {"user.", QUOTA_LIMIT_KEY, QUOTA_LIMIT_OBJECTS_KEY, GF_SELINUX_XATTR_KEY, + GF_XATTR_MDATA_KEY, NULL}; char *dht_dbg_vxattrs[] = {DHT_DBG_HASHED_SUBVOL_PATTERN, NULL}; diff --git a/xlators/cluster/ec/src/ec-heal.c b/xlators/cluster/ec/src/ec-heal.c index fb0867e9db5..c4f3d07f022 100644 --- a/xlators/cluster/ec/src/ec-heal.c +++ b/xlators/cluster/ec/src/ec-heal.c @@ -2309,9 +2309,10 @@ ec_restore_time_and_adjust_versions(call_frame_t *frame, ec_t *ec, fd_t *fd, loc.inode = inode_ref(fd->inode); gf_uuid_copy(loc.gfid, fd->inode->gfid); - ret = cluster_setattr(ec->xl_list, healed_sinks, ec->nodes, replies, - output, frame, ec->xl, &loc, &source_buf, - GF_SET_ATTR_ATIME | GF_SET_ATTR_MTIME, NULL); + ret = cluster_setattr( + ec->xl_list, healed_sinks, ec->nodes, replies, output, frame, + ec->xl, &loc, &source_buf, + GF_SET_ATTR_ATIME | GF_SET_ATTR_MTIME | GF_SET_ATTR_CTIME, NULL); EC_INTERSECT(healed_sinks, healed_sinks, output, ec->nodes); if (EC_COUNT(healed_sinks, ec->nodes) == 0) { ret = -ENOTCONN; -- cgit