diff options
author | Krishnan Parthasarathi <kp@gluster.com> | 2012-04-18 15:45:44 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2012-04-28 07:52:13 -0700 |
commit | 99bdbb2ed9697bb93f006d4060d4f1aaeb0850af (patch) | |
tree | 4632dd2c77d53dc20a9f8b082b0f9f51779886ac /xlators/mgmt/glusterd | |
parent | 4c84a4cd5e5e563e1e91656f7462b4c444e5f4e6 (diff) |
glusterd: Fail replace-brick subcmds on bricks other src/dst.
Change-Id: I5b55d3e353e70a9d4d8b7948853cbfa5b001a447
BUG: 811956
Signed-off-by: Krishnan Parthasarathi <kp@gluster.com>
Reviewed-on: http://review.gluster.com/3184
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/mgmt/glusterd')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-replace-brick.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c index c68b2ce4d4a..fdfa9c020e1 100644 --- a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c +++ b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c @@ -441,20 +441,22 @@ glusterd_op_stage_replace_brick (dict_t *dict, char **op_errstr, goto out; } - if ((volinfo->rb_status ==GF_RB_STATUS_NONE) && + ret = glusterd_brickinfo_from_brick (dst_brick, &dst_brickinfo); + if (ret) + goto out; + + if ((volinfo->rb_status ==GF_RB_STATUS_NONE) && (replace_op == GF_REPLACE_OP_START || replace_op == GF_REPLACE_OP_COMMIT_FORCE)) { - ret = glusterd_brickinfo_from_brick (dst_brick, &dst_brickinfo); + volinfo->src_brick = src_brickinfo; volinfo->dst_brick = dst_brickinfo; - } else { - ret = glusterd_get_rb_dst_brickinfo (volinfo, &dst_brickinfo); } if (glusterd_rb_check_bricks (volinfo, src_brickinfo, dst_brickinfo)) { ret = -1; - *op_errstr = gf_strdup ("incorrect source or " + *op_errstr = gf_strdup ("Incorrect source or " "destination brick"); if (*op_errstr) gf_log (THIS->name, GF_LOG_ERROR, "%s", *op_errstr); |