diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2016-05-12 13:55:44 +0530 |
---|---|---|
committer | Niels de Vos <ndevos@redhat.com> | 2016-05-14 07:12:38 -0700 |
commit | 91dcbfb58ac06b84940d3de9049514465a3acd6b (patch) | |
tree | 8fd05ba0b70e60e8a33de40542f5f2306b66b654 | |
parent | 36db3f20c790e0873ee2c560a046f90335d92ffe (diff) |
cluster/afr: Handle non-zero source in heal-info decision
Backport of http://review.gluster.org/14302
Problem:
Spurious entries are reported in heal info when the mount is on second/third
brick of the replica pair because local-child is given preference in selecting
source. The code is supposed to suggest the file needs heal if the (source < 0)
(failure code path), but instead it is written as if any non-zero value
is considered failure.
Fix:
Treat +ve source as success case
BUG: 1335433
Change-Id: Iede983b6560622964e91306405587da3f1de5748
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/14303
Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
Smoke: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-by: Anuradha Talur <atalur@redhat.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
-rw-r--r-- | xlators/cluster/afr/src/afr-common.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c index 160170e035c..08186b0bbcb 100644 --- a/xlators/cluster/afr/src/afr-common.c +++ b/xlators/cluster/afr/src/afr-common.c @@ -4572,11 +4572,11 @@ out: } gf_boolean_t -afr_decide_heal_info (afr_private_t *priv, unsigned char *sources, int ret) +afr_decide_heal_info (afr_private_t *priv, unsigned char *sources, int source) { int sources_count = 0; - if (ret) + if (source < 0) goto out; sources_count = AFR_COUNT (sources, priv->child_count); |