From 82394d484803e02e28441bc0b988efaaff60dd94 Mon Sep 17 00:00:00 2001 From: Vikas Gorur Date: Mon, 20 Apr 2009 03:54:04 -0700 Subject: Check return value of afr_sh_select_source. If select_source returns -1, abort self-heal. Signed-off-by: Anand V. Avati --- xlators/cluster/afr/src/afr-self-heal-data.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'xlators/cluster/afr/src/afr-self-heal-data.c') diff --git a/xlators/cluster/afr/src/afr-self-heal-data.c b/xlators/cluster/afr/src/afr-self-heal-data.c index a7a3d44f7..29ede0076 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 */ -- cgit