diff options
| author | Pranith K <pranithk@gluster.com> | 2010-10-20 01:20:59 +0000 | 
|---|---|---|
| committer | Anand V. Avati <avati@dev.gluster.com> | 2010-10-24 21:13:53 -0700 | 
| commit | a9187b9609dacb017aff171c317cd5332ef64bd5 (patch) | |
| tree | 2669dd41a548cbaea7250b98570bb5fba5382b57 /xlators/mgmt/glusterd/src/glusterd-handler.c | |
| parent | db61075a123008ebd94ab8ff00b984e484155654 (diff) | |
mgmt/glusterd: resolve the bricks before comparing uuid
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 1985 (peer detach fails if bricks are not resolved)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1985
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-handler.c')
| -rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-handler.c | 23 | 
1 files changed, 16 insertions, 7 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c index 51704b3d22c..9ef81a4a7dc 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handler.c +++ b/xlators/mgmt/glusterd/src/glusterd-handler.c @@ -624,15 +624,23 @@ glusterd_handle_cli_deprobe (rpcsvc_request_t *req)                  goto out;          } -        ret = glusterd_all_volume_cond_check (glusterd_friend_brick_belongs, -                                              -1, &uuid); -        if (ret) { -                op_errno = GF_DEPROBE_BRICK_EXIST; -                goto out; +        if (!uuid_is_null (uuid)) { +                ret = glusterd_all_volume_cond_check ( +                                                glusterd_friend_brick_belongs, +                                                -1, &uuid); +                if (ret) { +                        op_errno = GF_DEPROBE_BRICK_EXIST; +                        goto out; +                }          } -        ret = glusterd_deprobe_begin (req, cli_req.hostname, -                                      cli_req.port, uuid); +        if (!uuid_is_null (uuid)) { +                ret = glusterd_deprobe_begin (req, cli_req.hostname, +                                              cli_req.port, uuid); +        } else { +                ret = glusterd_deprobe_begin (req, cli_req.hostname, +                                              cli_req.port, NULL); +        }          gf_cmd_log ("peer deprobe", "on host %s:%d %s", cli_req.hostname,                      cli_req.port, (ret) ? "FAILED" : "SUCCESS"); @@ -641,6 +649,7 @@ out:                  ret = glusterd_xfer_cli_deprobe_resp (req, ret, op_errno,                                                        cli_req.hostname);          } +          if (cli_req.hostname)                  free (cli_req.hostname);//malloced by xdr          return ret;  | 
