From 3ad81d490f9e822efa34b3ffaf3c527e99af5d40 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Wed, 18 Apr 2012 14:48:35 +0530 Subject: cluster/afr: Set errno correctly in find_fresh_parents failures Change-Id: I923103a03c1efe38285cd70842ec91b98a3f6bfd BUG: 765551 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.com/3185 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/cluster/afr/src/afr-self-heal-common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c index 5e961a39a8a..62dbfbaeca4 100644 --- a/xlators/cluster/afr/src/afr-self-heal-common.c +++ b/xlators/cluster/afr/src/afr-self-heal-common.c @@ -1711,6 +1711,7 @@ afr_sh_find_fresh_parents (call_frame_t *frame, xlator_t *this, gf_log (this->name, GF_LOG_ERROR, "No sources for dir " "of %s, in missing entry self-heal, aborting " "self-heal", local->loc.path); + op_errno = EIO; goto out; } @@ -1718,6 +1719,7 @@ afr_sh_find_fresh_parents (call_frame_t *frame, xlator_t *this, if (source == -1) { GF_ASSERT (0); gf_log (this->name, GF_LOG_DEBUG, "No active sources found."); + op_errno = EIO; goto out; } afr_get_fresh_children (sh->success_children, sh->sources, @@ -1728,7 +1730,7 @@ afr_sh_find_fresh_parents (call_frame_t *frame, xlator_t *this, return; out: - afr_sh_set_error (sh, EIO); + afr_sh_set_error (sh, op_errno); sh->op_failed = 1; afr_sh_missing_entries_finish (frame, this); return; -- cgit