diff options
author | Ravishankar N <ravishankar@redhat.com> | 2017-03-04 01:04:10 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2017-03-06 05:01:43 -0500 |
commit | 804a65f07ea8e2093f781807651d0d07513b2627 (patch) | |
tree | fd07910c2e6960ce77123ee6898655d3b7a0cc16 /xlators/cluster/afr/src/afr-self-heal-metadata.c | |
parent | 78c5c5637104cf79578d0fb9173647c9c3421177 (diff) |
afr: restore atime/mtime for non-regular files
AFR restores atime/mtime only as a part of data heal. For non-regular
files (dirs, symlinks, char/block/socket files etc) which do not undergo
data-heal, atime/mtime is not restored.
This patch restores atime/mtime as a part of metadata heal for such
files.
Change-Id: Id8da885fc93fdf65c2f4bae2af3605b146ac1f16
BUG: 1429198
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-on: https://review.gluster.org/16844
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heal-metadata.c')
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-metadata.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-metadata.c b/xlators/cluster/afr/src/afr-self-heal-metadata.c index 5839ddc2e0f..e7653030e45 100644 --- a/xlators/cluster/afr/src/afr-self-heal-metadata.c +++ b/xlators/cluster/afr/src/afr-self-heal-metadata.c @@ -431,6 +431,13 @@ afr_selfheal_metadata (call_frame_t *frame, xlator_t *this, inode_t *inode) if (ret) goto unlock; + /* Restore atime/mtime for files that don't need data heal as + * restoring timestamps happens only as a part of data-heal. + */ + if (!IA_ISREG (locked_replies[source].poststat.ia_type)) + afr_selfheal_restore_time (frame, this, inode, source, + healed_sinks, locked_replies); + ret = afr_selfheal_undo_pending (frame, this, inode, sources, sinks, healed_sinks, undid_pending, |