From acea7409a35d03c438ff2738f701add26f0061c9 Mon Sep 17 00:00:00 2001 From: Kaushal M Date: Wed, 14 Sep 2011 18:29:18 +0530 Subject: glusterd, cli: adds 'force' for 'peer detach' Adds add a 'force' option to 'peer detach' to forcefully detach a peer from a cluster, even when the cluster contains volumes with bricks on the peer. Change-Id: I134df51c16a07345c8869b318141d427b572eba5 BUG: 3549 Reviewed-on: http://review.gluster.com/429 Tested-by: Gluster Build System Reviewed-by: Krishnan Parthasarathi --- xlators/mgmt/glusterd/src/glusterd-handler.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-handler.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c index 4e4b73bf493..497813065a2 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handler.c +++ b/xlators/mgmt/glusterd/src/glusterd-handler.c @@ -693,7 +693,7 @@ int glusterd_handle_cli_deprobe (rpcsvc_request_t *req) { int32_t ret = -1; - gf1_cli_probe_req cli_req = {0,}; + gf1_cli_deprobe_req cli_req = {0,}; uuid_t uuid = {0}; int op_errno = 0; xlator_t *this = NULL; @@ -705,7 +705,8 @@ glusterd_handle_cli_deprobe (rpcsvc_request_t *req) GF_ASSERT (priv); GF_ASSERT (req); - if (!xdr_to_generic (req->msg[0], &cli_req, (xdrproc_t)xdr_gf1_cli_probe_req)) { + if (!xdr_to_generic (req->msg[0], &cli_req, + (xdrproc_t)xdr_gf1_cli_deprobe_req)) { //failed to decode msg; req->rpc_err = GARBAGE_ARGS; goto out; @@ -725,7 +726,7 @@ glusterd_handle_cli_deprobe (rpcsvc_request_t *req) goto out; } - if (!uuid_is_null (uuid)) { + if (!uuid_is_null (uuid) && !(cli_req.flags & GF_CLI_FLAG_OP_FORCE)) { ret = glusterd_all_volume_cond_check ( glusterd_friend_brick_belongs, -1, &uuid); -- cgit