summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);