From 5c68937ef943a5ed8179cb19fef833f2be790588 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Sun, 19 Feb 2017 17:19:33 +0100 Subject: 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 Reviewed-on: https://review.gluster.org/16676 Smoke: Gluster Build System Reviewed-by: Jeff Darcy Tested-by: Jeff Darcy NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Amar Tumballi --- xlators/cluster/dht/src/dht-rebalance.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'xlators/cluster/dht/src') 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; -- cgit