Propogate rebalance already started error to cli

Signed-off-by: shishir gowda <shishirng@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>

BUG: 1882 (starting rebalance while previous rebalance is still running)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1882
This commit is contained in:
shishir gowda 2010-10-19 03:02:10 +00:00 committed by Anand V. Avati
parent 54219ecf2a
commit 5ca019f339
2 changed files with 4 additions and 0 deletions

View File

@ -770,6 +770,9 @@ gf_cli3_1_defrag_volume_cbk (struct rpc_req *req, struct iovec *iov,
if (cmd == GF_DEFRAG_CMD_START) {
cli_out ("starting rebalance on volume %s has been %s", volname,
(rsp.op_ret) ? "unsuccessful": "successful");
if (rsp.op_ret && rsp.op_errno == EEXIST)
cli_out ("Rebalance already started on volume %s",
volname);
}
if (cmd == GF_DEFRAG_CMD_STOP) {
if (rsp.op_ret == -1)

View File

@ -412,6 +412,7 @@ glusterd_handle_defrag_volume (rpcsvc_request_t *req)
gf_log ("glusterd", GF_LOG_DEBUG,
"rebalance on volume %s already started",
cli_req.volname);
rsp.op_errno = EEXIST;
goto out;
}