diff options
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-common.c | 1 | ||||
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-data.c | 9 | ||||
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-metadata.c | 9 |
3 files changed, 18 insertions, 1 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c index f6a4bf9fbb2..6a7f2d93c0b 100644 --- a/xlators/cluster/afr/src/afr-self-heal-common.c +++ b/xlators/cluster/afr/src/afr-self-heal-common.c @@ -29,7 +29,6 @@ /** * select_source - select a source and return it - * TODO: take into account option 'favorite-child' */ int diff --git a/xlators/cluster/afr/src/afr-self-heal-data.c b/xlators/cluster/afr/src/afr-self-heal-data.c index a7a3d44f7ad..29ede007604 100644 --- a/xlators/cluster/afr/src/afr-self-heal-data.c +++ b/xlators/cluster/afr/src/afr-self-heal-data.c @@ -821,6 +821,15 @@ afr_sh_data_fix (call_frame_t *frame, xlator_t *this) } source = afr_sh_select_source (sh->sources, priv->child_count); + + if (source == -1) { + gf_log (this->name, GF_LOG_DEBUG, + "No active sources found."); + + afr_sh_data_finish (frame, this); + return 0; + } + sh->source = source; /* detect changes not visible through pending flags -- JIC */ diff --git a/xlators/cluster/afr/src/afr-self-heal-metadata.c b/xlators/cluster/afr/src/afr-self-heal-metadata.c index 8e832698fca..6468d7fc82a 100644 --- a/xlators/cluster/afr/src/afr-self-heal-metadata.c +++ b/xlators/cluster/afr/src/afr-self-heal-metadata.c @@ -568,6 +568,15 @@ afr_sh_metadata_fix (call_frame_t *frame, xlator_t *this) } source = afr_sh_select_source (sh->sources, priv->child_count); + + if (source == -1) { + gf_log (this->name, GF_LOG_DEBUG, + "No active sources found."); + + afr_sh_metadata_finish (frame, this); + return 0; + } + sh->source = source; /* detect changes not visible through pending flags -- JIC */ |