summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht
diff options
context:
space:
mode:
authorSusant Palai <spalai@redhat.com>2016-11-09 16:39:44 +0530
committerRaghavendra G <rgowdapp@redhat.com>2017-03-09 23:56:19 -0500
commit64442122958011a3e7e73c5d205f37ac0da46736 (patch)
tree25f771736fa37c57a536c9fe45a46a4320a560d0 /xlators/cluster/dht
parent90b2b9b29f552fe9ab53de5c4123003522399e6d (diff)
dht/rebalance: update op_errno for rebalance failures
function "rebalance_task_completion" did not honor returned values other than -1 and 1. This led to ignoring errno e.g in the current bug, ENOTSUP returned by __is_file_migratable and it returned EINVAL(op_errno initialized) to it's caller leading to failure messages logged in ERROR level. Change-Id: I45549fba35c72b278539269b750768fd89e0faf2 BUG: 1393338 Signed-off-by: Susant Palai <spalai@redhat.com> Reviewed-on: https://review.gluster.org/15810 Smoke: Gluster Build System <jenkins@build.gluster.org> Tested-by: Raghavendra G <rgowdapp@redhat.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators/cluster/dht')
-rw-r--r--xlators/cluster/dht/src/dht-rebalance.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c
index 4f422560449..bc6e983cd0a 100644
--- a/xlators/cluster/dht/src/dht-rebalance.c
+++ b/xlators/cluster/dht/src/dht-rebalance.c
@@ -1929,15 +1929,16 @@ rebalance_task_completion (int op_ret, call_frame_t *sync_frame, void *data)
no space to migrate-data
*/
op_errno = ENOSPC;
- }
-
- if (op_ret == 1) {
+ } else if (op_ret == 1) {
/* migration didn't happen, but is not a failure, let the user
understand that he doesn't have permission to migrate the
file.
*/
op_ret = -1;
op_errno = EPERM;
+ } else if (op_ret != 0) {
+ op_errno = -op_ret;
+ op_ret = -1;
}
DHT_STACK_UNWIND (setxattr, sync_frame, op_ret, op_errno, NULL);