diff options
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heal-data.c')
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-data.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-data.c b/xlators/cluster/afr/src/afr-self-heal-data.c index 4becfb835e8..1b3b1ca0af1 100644 --- a/xlators/cluster/afr/src/afr-self-heal-data.c +++ b/xlators/cluster/afr/src/afr-self-heal-data.c @@ -579,6 +579,7 @@ __afr_selfheal_data_finalize_source (call_frame_t *frame, xlator_t *this, unsigned char *sinks, unsigned char *healed_sinks, unsigned char *locked_on, + unsigned char *undid_pending, struct afr_reply *replies, uint64_t *witness) { @@ -599,6 +600,12 @@ __afr_selfheal_data_finalize_source (call_frame_t *frame, xlator_t *this, AFR_DATA_TRANSACTION); if (source < 0) return -EIO; + + _afr_fav_child_reset_sink_xattrs (frame, this, inode, source, + healed_sinks, undid_pending, + AFR_DATA_TRANSACTION, + locked_on, replies); + return source; } @@ -638,6 +645,7 @@ __afr_selfheal_data_prepare (call_frame_t *frame, xlator_t *this, inode_t *inode, unsigned char *locked_on, unsigned char *sources, unsigned char *sinks, unsigned char *healed_sinks, + unsigned char *undid_pending, struct afr_reply *replies, gf_boolean_t *pflag) { int ret = -1; @@ -673,8 +681,8 @@ __afr_selfheal_data_prepare (call_frame_t *frame, xlator_t *this, source = __afr_selfheal_data_finalize_source (frame, this, inode, sources, sinks, healed_sinks, - locked_on, replies, - witness); + locked_on, undid_pending, + replies, witness); if (source < 0) return -EIO; @@ -692,6 +700,7 @@ __afr_selfheal_data (call_frame_t *frame, xlator_t *this, fd_t *fd, unsigned char *sinks = NULL; unsigned char *data_lock = NULL; unsigned char *healed_sinks = NULL; + unsigned char *undid_pending = NULL; struct afr_reply *locked_replies = NULL; int source = -1; gf_boolean_t did_sh = _gf_true; @@ -703,6 +712,7 @@ __afr_selfheal_data (call_frame_t *frame, xlator_t *this, fd_t *fd, sinks = alloca0 (priv->child_count); healed_sinks = alloca0 (priv->child_count); data_lock = alloca0 (priv->child_count); + undid_pending = alloca0 (priv->child_count); locked_replies = alloca0 (sizeof (*locked_replies) * priv->child_count); @@ -722,9 +732,8 @@ __afr_selfheal_data (call_frame_t *frame, xlator_t *this, fd_t *fd, ret = __afr_selfheal_data_prepare (frame, this, fd->inode, data_lock, sources, sinks, - healed_sinks, - locked_replies, - NULL); + healed_sinks, undid_pending, + locked_replies, NULL); if (ret < 0) goto unlock; @@ -783,7 +792,7 @@ restore_time: } ret = afr_selfheal_undo_pending (frame, this, fd->inode, sources, sinks, healed_sinks, - AFR_DATA_TRANSACTION, + undid_pending, AFR_DATA_TRANSACTION, locked_replies, data_lock); skip_undo_pending: afr_selfheal_uninodelk (frame, this, fd->inode, this->name, 0, 0, |