diff options
| author | Rajesh Amaravathi <rajesh@redhat.com> | 2011-12-27 15:09:39 +0530 | 
|---|---|---|
| committer | Vijay Bellur <vijay@gluster.com> | 2012-01-12 21:37:48 -0800 | 
| commit | 3207a33ef67ed0d065935360adb309a7ae046317 (patch) | |
| tree | 8f8f1a4786eb10844c5b64bf6e8aa73c1b3d90a8 /xlators/mgmt/glusterd/src/glusterd-replace-brick.c | |
| parent | 919e3424849db2276e003dcd919a470838bf084f (diff) | |
glusterd: improve replace brick status message
when replace-brick status is invoked without starting
replace brick on the specified bricks, appropriate error
message is displayed
Change-Id: I57230db84314caf807f1ff54f74307d85bdc1633
BUG: 769926
Signed-off-by: Rajesh Amaravathi <rajesh@redhat.com>
Reviewed-on: http://review.gluster.com/2531
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Amar Tumballi <amar@gluster.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-replace-brick.c')
| -rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-replace-brick.c | 24 | 
1 files changed, 22 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c index 93b6430d173..dfa9b5dd317 100644 --- a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c +++ b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c @@ -378,8 +378,24 @@ glusterd_op_stage_replace_brick (dict_t *dict, char **op_errstr,                  break;          case GF_REPLACE_OP_COMMIT_FORCE: break; +          case GF_REPLACE_OP_STATUS: + +                if (glusterd_is_rb_ongoing (volinfo) == _gf_false) { +                        ret = gf_asprintf (op_errstr, "replace-brick not" +                                           " started on volume %s", +                                           volinfo->volname); +                        if (ret < 0) { +                                *op_errstr = NULL; +                                goto out; +                        } + +                        gf_log (THIS->name, GF_LOG_ERROR, "%s", *op_errstr); +                        ret = -1; +                        goto out; +                }                  break; +          default:                  ret = -1;                  goto out; @@ -472,11 +488,15 @@ glusterd_op_stage_replace_brick (dict_t *dict, char **op_errstr,          }          if (glusterd_rb_check_bricks (volinfo, src_brickinfo, dst_brickinfo)) { -                gf_log ("", GF_LOG_ERROR, "replace brick: incorrect source or" -                       " destination bricks specified"); +                  ret = -1; +                *op_errstr = gf_strdup ("incorrect source or " +                                        "destination brick"); +                if (*op_errstr) +                        gf_log (THIS->name, GF_LOG_ERROR, "%s", *op_errstr);                  goto out;         } +          if (!glusterd_is_local_addr (host)) {                  ret = glusterd_brick_create_path (host, path,                                                    volinfo->volume_id, 0777,  | 
