From 5065b0824ed01cca59501d74c227b136a5b0e65e Mon Sep 17 00:00:00 2001 From: Pavan Sondur Date: Mon, 16 Aug 2010 02:37:34 +0000 Subject: mgmt/glusterd: cli: Various fixes for replace brick. Signed-off-by: Pavan Vilas Sondur Signed-off-by: Anand V. Avati BUG: 1304 (Free state info for replace brick) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1304 --- cli/src/cli3_1-cops.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'cli') diff --git a/cli/src/cli3_1-cops.c b/cli/src/cli3_1-cops.c index 8f81815e803..9d1b3c1f87c 100644 --- a/cli/src/cli3_1-cops.c +++ b/cli/src/cli3_1-cops.c @@ -750,6 +750,16 @@ gf_cli3_1_replace_brick_cbk (struct rpc_req *req, struct iovec *iov, goto out; } + snprintf (cmd_str, 4096, "gluster volume replace-brick %s %s %s abort >/dev/null", + local->u.replace_brick.volname, src_brick, dst_brick); + + ret = system (cmd_str); + if (ret) { + gf_log ("", GF_LOG_DEBUG, + "add brick failed"); + goto out; + } + snprintf (cmd_str, 4096, "gluster volume add-brick %s %s >/dev/null", local->u.replace_brick.volname, dst_brick); @@ -1362,7 +1372,7 @@ gf_cli3_1_replace_brick (call_frame_t *frame, xlator_t *this, goto out; } - local->u.replace_brick.volname = strdup (req.volname); + local->u.replace_brick.volname = gf_strdup (req.volname); if (!local->u.replace_brick.volname) { gf_log (this->name, GF_LOG_ERROR, "Out of memory"); -- cgit