summaryrefslogtreecommitdiffstats
path: root/cli/src/cli3_1-cops.c
diff options
context:
space:
mode:
authorPavan Sondur <pavan@gluster.com>2010-08-16 02:37:34 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-08-16 01:49:04 -0700
commit5065b0824ed01cca59501d74c227b136a5b0e65e (patch)
treea42ab52185544e0144e095e1767d368b92763a32 /cli/src/cli3_1-cops.c
parent659e2d938f4da023411114c13a14337c21083411 (diff)
mgmt/glusterd: cli: Various fixes for replace brick.
Signed-off-by: Pavan Vilas Sondur <pavan@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 1304 (Free state info for replace brick) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1304
Diffstat (limited to 'cli/src/cli3_1-cops.c')
-rw-r--r--cli/src/cli3_1-cops.c12
1 files changed, 11 insertions, 1 deletions
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");