summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht
diff options
context:
space:
mode:
authorMichael Scherer <misc@redhat.com>2017-02-19 17:19:33 +0100
committerJeff Darcy <jeff@pl.atyp.us>2017-05-04 14:58:16 +0000
commit5c68937ef943a5ed8179cb19fef833f2be790588 (patch)
tree2bc42e6a0604374adfaf469aa05ac7ad00cea056 /xlators/cluster/dht
parent7178c299d727e98370835ba3dde41f91f087e724 (diff)
Fix wrong operators
Coverty rightfully note that if we verify that A =! C or A != B, it will always be true. In one case, that prevent healing from continuing. In the other, that trigger useless logs. Fixing this bug also show that ENOSPC shouldn't abort the rebalance operation, as seen during the review of the first patch on https://review.gluster.org/#/c/16676/1/xlators/cluster/dht/src/dht-rebalance.c Change-Id: I93c4df43b880b211da202a7e49cef6b1ce7ab68f BUG: 1424817 Signed-off-by: Michael Scherer <misc@redhat.com> Reviewed-on: https://review.gluster.org/16676 Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Jeff Darcy <jeff@pl.atyp.us> Tested-by: Jeff Darcy <jeff@pl.atyp.us> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'xlators/cluster/dht')
-rw-r--r--xlators/cluster/dht/src/dht-rebalance.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c
index 1b140dbb8b5..ee0631689ee 100644
--- a/xlators/cluster/dht/src/dht-rebalance.c
+++ b/xlators/cluster/dht/src/dht-rebalance.c
@@ -2359,7 +2359,7 @@ gf_defrag_handle_migrate_error (int32_t op_errno, gf_defrag_info_t *defrag)
{
/* if errno is not ENOSPC or ENOTCONN, we can still continue
with rebalance process */
- if ((op_errno != ENOSPC) || (op_errno != ENOTCONN))
+ if ((op_errno != ENOSPC) && (op_errno != ENOTCONN))
return 1;
if (op_errno == ENOTCONN) {
@@ -2374,8 +2374,7 @@ gf_defrag_handle_migrate_error (int32_t op_errno, gf_defrag_info_t *defrag)
/* rebalance process itself failed, may be
remote brick went down, or write failed due to
disk full etc etc.. */
- defrag->defrag_status = GF_DEFRAG_STATUS_FAILED;
- return -1;
+ return 0;
}
return 0;