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 | 12 | 
1 files changed, 3 insertions, 9 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-data.c b/xlators/cluster/afr/src/afr-self-heal-data.c index ebf262e4f36..332471c87e6 100644 --- a/xlators/cluster/afr/src/afr-self-heal-data.c +++ b/xlators/cluster/afr/src/afr-self-heal-data.c @@ -577,7 +577,6 @@ __afr_selfheal_data_finalize_source (call_frame_t *frame, xlator_t *this,  				     struct afr_reply *replies,                                       uint64_t *witness)  { -	int i = 0;  	afr_private_t *priv = NULL;  	int source = -1;  	int sources_count = 0; @@ -614,13 +613,9 @@ __afr_selfheal_data_finalize_source (call_frame_t *frame, xlator_t *this,  out:          afr_mark_active_sinks (this, sources, locked_on, healed_sinks); +        source = afr_choose_source_by_policy (priv, sources, +                                              AFR_DATA_TRANSACTION); -        for (i = 0; i < priv->child_count; i++) { -                if (sources[i]) { -                        source = i; -                        break; -                } -        }  	return source;  } @@ -734,8 +729,7 @@ __afr_selfheal_data (call_frame_t *frame, xlator_t *this, fd_t *fd,  		source = ret; -                if (AFR_IS_ARBITER_BRICK(priv, source) && -                    AFR_COUNT (sources, priv->child_count) == 1) { +                if (AFR_IS_ARBITER_BRICK(priv, source)) {                          did_sh = _gf_false;                          goto unlock;                  }  | 
