summaryrefslogtreecommitdiffstats
path: root/glusterfsd/src
diff options
context:
space:
mode:
authorMohit Agrawal <moagrawal@redhat.com>2019-01-12 11:17:23 +0530
committerAmar Tumballi <amarts@redhat.com>2019-01-14 12:34:40 +0000
commitf578cdad23d8a8428a7012f777f4987507f19ea4 (patch)
tree883d34cd9a14eb05e2e175a227062a223df64a44 /glusterfsd/src
parent211521f039bb5c883ef444577b5962bad9e18be1 (diff)
core: glusterd/add-brick-and-validate-replicated-volume-options.t is crash
Problem: Sometime brick is getting crash at the time of handling pmap signin request Solution: glusterfs_mgmt_pamp_signin is using same frame to send pmap signin request so to avoid crash send signin request on separate frame Change-Id: I443f854171ec4372e8d5f84bdc576c468e92c493 fixes: bz#1665656 Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
Diffstat (limited to 'glusterfsd/src')
-rw-r--r--glusterfsd/src/glusterfsd-mgmt.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c
index 33c824c132e..3c3c1ef997c 100644
--- a/glusterfsd/src/glusterfsd-mgmt.c
+++ b/glusterfsd/src/glusterfsd-mgmt.c
@@ -1736,7 +1736,6 @@ glusterfs_handle_barrier(rpcsvc_request_t *req)
goto submit_reply;
}
-
submit_reply:
THIS = old_THIS;
@@ -2841,7 +2840,6 @@ glusterfs_mgmt_pmap_signin(glusterfs_ctx_t *ctx)
0,
};
- frame = create_frame(THIS, ctx->pool);
cmd_args = &ctx->cmd_args;
if (!cmd_args->brick_port || !cmd_args->brick_name) {
@@ -2865,6 +2863,7 @@ glusterfs_mgmt_pmap_signin(glusterfs_ctx_t *ctx)
if (ctx->active) {
top = ctx->active->first;
for (trav_p = &top->children; *trav_p; trav_p = &(*trav_p)->next) {
+ frame = create_frame(THIS, ctx->pool);
req.brick = (*trav_p)->xlator->name;
ret = mgmt_submit_request(&req, frame, ctx, &clnt_pmap_prog,
GF_PMAP_SIGNIN, mgmt_pmap_signin_cbk,
@@ -2874,11 +2873,8 @@ glusterfs_mgmt_pmap_signin(glusterfs_ctx_t *ctx)
"failed to send sign in request; brick = %s", req.brick);
}
}
- } else {
- ret = mgmt_submit_request(&req, frame, ctx, &clnt_pmap_prog,
- GF_PMAP_SIGNIN, mgmt_pmap_signin_cbk,
- (xdrproc_t)xdr_pmap_signin_req);
}
+
/* unfortunately, the caller doesn't care about the returned value */
out:
ERROR, "Replace brick is already " "started for volume "); ret = -1; goto out; } break; case GF_REPLACE_OP_PAUSE: if (glusterd_is_rb_paused (volinfo)) { gf_log ("", GF_LOG_ERROR, "Replace brick is already " "paused for volume "); ret = -1; goto out; } else if (!glusterd_is_rb_started(volinfo)) { gf_log ("", GF_LOG_ERROR, "Replace brick is not" " started for volume "); ret = -1; goto out; } break; case GF_REPLACE_OP_ABORT: if ((!glusterd_is_rb_paused (volinfo)) && (!glusterd_is_rb_started (volinfo))) { gf_log ("", GF_LOG_ERROR, "Replace brick is not" " started or paused for volume "); ret = -1; goto out; } break; case GF_REPLACE_OP_COMMIT: if (!glusterd_is_rb_started (volinfo)) { gf_log ("", GF_LOG_ERROR, "Replace brick is not " "started for volume "); ret = -1; goto out; } 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; } ret = glusterd_volume_brickinfo_get_by_brick (src_brick, volinfo, &src_brickinfo, GF_PATH_COMPLETE); if (ret) { snprintf (msg, sizeof (msg), "brick: %s does not exist in " "volume: %s", src_brick, volname); *op_errstr = gf_strdup (msg); goto out; } ctx = glusterd_op_get_ctx(); if (ctx) { if (!glusterd_is_fuse_available ()) { gf_log ("glusterd", GF_LOG_ERROR, "Unable to open /dev/" "fuse (%s), replace-brick command failed", strerror (errno)); snprintf (msg, sizeof(msg), "Fuse unavailable\n " "Replace-brick failed"); *op_errstr = gf_strdup (msg); ret = -1; goto out; } } if (!glusterd_is_local_addr (src_brickinfo->hostname)) { gf_log ("", GF_LOG_DEBUG, "I AM THE SOURCE HOST"); if (src_brickinfo->port && rsp_dict) { ret = dict_set_int32 (rsp_dict, "src-brick-port", src_brickinfo->port); if (ret) { gf_log ("", GF_LOG_DEBUG, "Could not set src-brick-port=%d", src_brickinfo->port); } } GLUSTERD_GET_VOLUME_DIR (voldir, volinfo, priv); GLUSTERD_GET_BRICK_PIDFILE (pidfile, voldir, src_brickinfo->hostname, src_brickinfo->path); if (!glusterd_is_service_running (pidfile, NULL)) { snprintf(msg, sizeof(msg), "Source brick %s:%s " "is not online.", src_brickinfo->hostname, src_brickinfo->path); *op_errstr = gf_strdup (msg); ret = -1; goto out; } } dup_dstbrick = gf_strdup (dst_brick); if (!dup_dstbrick) { ret = -1; gf_log ("", GF_LOG_ERROR, "Memory allocation failed"); goto out; } host = strtok (dup_dstbrick, ":"); path = strtok (NULL, ":"); if (!host || !path) { gf_log ("", GF_LOG_ERROR, "dst brick %s is not of form :", dst_brick); ret = -1; goto out; } if (!glusterd_brickinfo_get (NULL, host, path, NULL)) { snprintf(msg, sizeof(msg), "Brick: %s:%s already in use", host, path); *op_errstr = gf_strdup (msg); ret = -1; goto out; } if ((volinfo->rb_status ==GF_RB_STATUS_NONE) && (replace_op == GF_REPLACE_OP_START)) { 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 " "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, op_errstr); if (ret) goto out; } else { ret = glusterd_friend_find (NULL, host, &peerinfo); if (ret) { snprintf (msg, sizeof (msg), "%s, is not a friend", host); *op_errstr = gf_strdup (msg); goto out; } if (!peerinfo->connected) { snprintf (msg, sizeof (msg), "%s, is not connected at " "the moment", host); *op_errstr = gf_strdup (msg); ret = -1; goto out; } if (GD_FRIEND_STATE_BEFRIENDED != peerinfo->state.state) { snprintf (msg, sizeof (msg), "%s, is not befriended " "at the moment", host); *op_errstr = gf_strdup (msg); ret = -1; goto out; } } ret = 0; out: if (dup_dstbrick) GF_FREE (dup_dstbrick); gf_log ("", GF_LOG_DEBUG, "Returning %d", ret); return ret; } static int rb_regenerate_volfiles (glusterd_volinfo_t *volinfo, glusterd_brickinfo_t *brickinfo, int32_t pump_needed) { dict_t *dict = NULL; int ret = 0; dict = volinfo->dict; gf_log ("", GF_LOG_DEBUG, "attempting to set pump value=%d", pump_needed); ret = dict_set_int32 (dict, "enable-pump", pump_needed); if (ret) { gf_log ("", GF_LOG_DEBUG, "could not dict_set enable-pump"); goto out; } ret = glusterd_create_rb_volfiles (volinfo, brickinfo); out: return ret; } static int rb_src_brick_restart (glusterd_volinfo_t *volinfo, glusterd_brickinfo_t *src_brickinfo, int activate_pump) { int ret = 0; gf_log ("", GF_LOG_DEBUG, "Attempting to kill src"); ret = glusterd_nfs_server_stop (volinfo); if (ret) { gf_log ("", GF_LOG_ERROR, "Unable to stop nfs, ret: %d", ret); } ret = glusterd_volume_stop_glusterfs (volinfo, src_brickinfo); if (ret) { gf_log ("", GF_LOG_ERROR, "Unable to stop " "glusterfs, ret: %d", ret); goto out; } glusterd_delete_volfile (volinfo, src_brickinfo); if (activate_pump) { ret = rb_regenerate_volfiles (volinfo, src_brickinfo, 1); if (ret) { gf_log ("", GF_LOG_DEBUG, "Could not regenerate volfiles with pump"); goto out; } } else { ret = rb_regenerate_volfiles (volinfo, src_brickinfo, 0); if (ret) { gf_log ("", GF_LOG_DEBUG, "Could not regenerate volfiles without pump"); goto out; } } sleep (2); ret = glusterd_volume_start_glusterfs (volinfo, src_brickinfo); if (ret) { gf_log ("", GF_LOG_ERROR, "Unable to start " "glusterfs, ret: %d", ret); goto out; } out: ret = glusterd_nfs_server_start (volinfo); if (ret) { gf_log ("", GF_LOG_ERROR, "Unable to start nfs, ret: %d", ret); } return ret; } static int rb_send_xattr_command (glusterd_volinfo_t *volinfo, glusterd_brickinfo_t *src_brickinfo, glusterd_brickinfo_t *dst_brickinfo, const char *xattr_key, const char *value) { glusterd_conf_t *priv = NULL; xlator_t *this = NULL; char mount_point_path[PATH_MAX] = {0,}; int ret = -1; this = THIS; priv = this->private; snprintf (mount_point_path, PATH_MAX, "%s/vols/%s/%s", priv->workdir, volinfo->volname, RB_CLIENT_MOUNTPOINT); ret = sys_lsetxattr (mount_point_path, xattr_key, value, strlen (value) + 1, 0); if (ret) gf_log (this->name, GF_LOG_DEBUG, "setxattr on key: " "%s failed", xattr_key); return ret; } static int rb_spawn_dst_brick (glusterd_volinfo_t *volinfo, glusterd_brickinfo_t *brickinfo) { glusterd_conf_t *priv = NULL; runner_t runner = {0,}; int ret = -1; int32_t port = 0; priv = THIS->private; port = pmap_registry_alloc (THIS); brickinfo->port = port; GF_ASSERT (port); runinit (&runner); runner_add_arg (&runner, SBIN_DIR"/glusterfs"); runner_argprintf (&runner, "-f" "%s/vols/%s/"RB_DSTBRICKVOL_FILENAME, priv->workdir, volinfo->volname); runner_argprintf (&runner, "-p" "%s/vols/%s/"RB_DSTBRICK_PIDFILE, priv->workdir, volinfo->volname); runner_add_arg (&runner, "--xlator-option"); runner_argprintf (&runner, "src-server.listen-port=%d", port); if (volinfo->memory_accounting) runner_add_arg (&runner, "--mem-accounting"); ret = runner_run (&runner); if (ret) { gf_log ("", GF_LOG_DEBUG, "Could not start glusterfs"); goto out; } gf_log ("", GF_LOG_DEBUG, "Successfully started glusterfs: brick=%s:%s", brickinfo->hostname, brickinfo->path); ret = 0; out: return ret; } static int rb_spawn_glusterfs_client (glusterd_volinfo_t *volinfo, glusterd_brickinfo_t *brickinfo) { glusterd_conf_t *priv = NULL; char cmd_str[8192] = {0,}; runner_t runner = {0,}; struct stat buf; int ret = -1; priv = THIS->private; runinit (&runner); runner_add_arg (&runner, SBIN_DIR"/glusterfs"); runner_argprintf (&runner, "-f" "%s/vols/%s/"RB_CLIENTVOL_FILENAME, priv->workdir, volinfo->volname); runner_argprintf (&runner, "%s/vols/%s/"RB_CLIENT_MOUNTPOINT, priv->workdir, volinfo->volname); if (volinfo->memory_accounting) runner_add_arg (&runner, "--mem-accounting"); ret = runner_run (&runner); if (ret) { gf_log ("", GF_LOG_DEBUG, "Could not start glusterfs"); goto out; } gf_log ("", GF_LOG_DEBUG, "Successfully started glusterfs: brick=%s:%s", brickinfo->hostname, brickinfo->path); memset (cmd_str, 0, sizeof (cmd_str)); snprintf (cmd_str, 4096, "%s/vols/%s/%s", priv->workdir, volinfo->volname, RB_CLIENT_MOUNTPOINT); ret = stat (cmd_str, &buf); if (ret) { gf_log ("", GF_LOG_DEBUG, "stat on mountpoint failed"); goto out; } gf_log ("", GF_LOG_DEBUG, "stat on mountpoint succeeded"); ret = 0; out: return ret; } static const char *client_volfile_str = "volume mnt-client\n" " type protocol/client\n" " option remote-host %s\n" " option remote-subvolume %s\n" " option remote-port %d\n" " option transport-type %s\n" " option username %s\n" " option password %s\n" "end-volume\n" "volume mnt-wb\n" " type performance/write-behind\n" " subvolumes mnt-client\n" "end-volume\n"; static int rb_generate_client_volfile (glusterd_volinfo_t *volinfo, glusterd_brickinfo_t *src_brickinfo) { glusterd_conf_t *priv = NULL; xlator_t *this = NULL; FILE *file = NULL; char filename[PATH_MAX] = {0, }; int ret = -1; int fd = -1; char *ttype = NULL; this = THIS; priv = this->private; gf_log (this->name, GF_LOG_DEBUG, "Creating volfile"); snprintf (filename, PATH_MAX, "%s/vols/%s/%s", priv->workdir, volinfo->volname, RB_CLIENTVOL_FILENAME); fd = open (filename, O_CREAT | O_RDONLY, S_IRUSR | S_IWUSR); if (fd < 0) { gf_log (this->name, GF_LOG_ERROR, "%s", strerror (errno)); goto out; } close (fd); file = fopen (filename, "w+"); if (!file) { gf_log (this->name, GF_LOG_DEBUG, "Open of volfile failed"); ret = -1; goto out; } GF_ASSERT (src_brickinfo->port); ttype = glusterd_get_trans_type_rb (volinfo->transport_type); if (NULL == ttype){ ret = -1; goto out; } fprintf (file, client_volfile_str, src_brickinfo->hostname, src_brickinfo->path, src_brickinfo->port, ttype, glusterd_auth_get_username (volinfo), glusterd_auth_get_password (volinfo)); fclose (file); GF_FREE (ttype); ret = 0; out: return ret; } static const char *dst_brick_volfile_str = "volume src-posix\n" " type storage/posix\n" " option directory %s\n" " option volume-id %s\n" "end-volume\n" "volume %s\n" " type features/locks\n" " subvolumes src-posix\n" "end-volume\n" "volume src-server\n" " type protocol/server\n" " option auth.login.%s.allow %s\n" " option auth.login.%s.password %s\n" " option auth.addr.%s.allow *\n" " option transport-type %s\n" " subvolumes %s\n" "end-volume\n"; static int rb_generate_dst_brick_volfile (glusterd_volinfo_t *volinfo, glusterd_brickinfo_t *dst_brickinfo) { glusterd_conf_t *priv = NULL; xlator_t *this = NULL; FILE *file = NULL; char filename[PATH_MAX] = {0, }; int ret = -1; int fd = -1; char *trans_type = NULL; this = THIS; priv = this->private; gf_log (this->name, GF_LOG_DEBUG, "Creating volfile"); snprintf (filename, PATH_MAX, "%s/vols/%s/%s", priv->workdir, volinfo->volname, RB_DSTBRICKVOL_FILENAME); fd = creat (filename, S_IRUSR | S_IWUSR); if (fd < 0) { gf_log (this->name, GF_LOG_ERROR, "%s", strerror (errno)); goto out; } close (fd); file = fopen (filename, "w+"); if (!file) { gf_log (this->name, GF_LOG_DEBUG, "Open of volfile failed"); ret = -1; goto out; } trans_type = glusterd_get_trans_type_rb (volinfo->transport_type); if (NULL == trans_type){ ret = -1; goto out; } fprintf (file, dst_brick_volfile_str, dst_brickinfo->path, uuid_utoa (volinfo->volume_id), dst_brickinfo->path, dst_brickinfo->path, glusterd_auth_get_username (volinfo), glusterd_auth_get_username (volinfo), glusterd_auth_get_password (volinfo), dst_brickinfo->path, trans_type, dst_brickinfo->path); GF_FREE (trans_type); fclose (file); ret = 0; out: return ret; } static int rb_mountpoint_mkdir (glusterd_volinfo_t *volinfo, glusterd_brickinfo_t *src_brickinfo) { glusterd_conf_t *priv = NULL; char mount_point_path[PATH_MAX] = {0,}; int ret = -1; priv = THIS->private; snprintf (mount_point_path, PATH_MAX, "%s/vols/%s/%s", priv->workdir, volinfo->volname, RB_CLIENT_MOUNTPOINT); ret = mkdir (mount_point_path, 0777); if (ret && (errno != EEXIST)) { gf_log ("", GF_LOG_DEBUG, "mkdir failed, errno: %d", errno); goto out; } ret = 0; out: return ret; } static int rb_mountpoint_rmdir (glusterd_volinfo_t *volinfo, glusterd_brickinfo_t *src_brickinfo) { glusterd_conf_t *priv = NULL; char mount_point_path[PATH_MAX] = {0,}; int ret = -1; priv = THIS->private; snprintf (mount_point_path, PATH_MAX, "%s/vols/%s/%s", priv->workdir, volinfo->volname, RB_CLIENT_MOUNTPOINT); ret = rmdir (mount_point_path); if (ret) { gf_log ("", GF_LOG_DEBUG, "rmdir failed"); goto out; } ret = 0; out: return ret; } static int rb_destroy_maintenance_client (glusterd_volinfo_t *volinfo, glusterd_brickinfo_t *src_brickinfo) { glusterd_conf_t *priv = NULL; runner_t runner = {0,}; char filename[PATH_MAX] = {0,}; int ret = -1; priv = THIS->private; runinit (&runner); runner_add_args (&runner, "/bin/umount", "-f", NULL); runner_argprintf (&runner, "%s/vols/%s/"RB_CLIENT_MOUNTPOINT, priv->workdir, volinfo->volname); ret = runner_run (&runner); if (ret) { gf_log ("", GF_LOG_DEBUG, "umount failed on maintenance client"); goto out; } ret = rb_mountpoint_rmdir (volinfo, src_brickinfo); if (ret) { gf_log ("", GF_LOG_DEBUG, "rmdir of mountpoint failed"); goto out; } snprintf (filename, PATH_MAX, "%s/vols/%s/%s", priv->workdir, volinfo->volname, RB_CLIENTVOL_FILENAME); ret = unlink (filename); if (ret) { gf_log ("", GF_LOG_DEBUG, "unlink failed"); goto out; } ret = 0; out: return ret; } static int rb_spawn_maintenance_client (glusterd_volinfo_t *volinfo, glusterd_brickinfo_t *src_brickinfo) { int ret = -1; ret = rb_generate_client_volfile (volinfo, src_brickinfo); if (ret) { gf_log ("", GF_LOG_DEBUG, "Unable to generate client " "volfile"); goto out; } ret = rb_mountpoint_mkdir (volinfo, src_brickinfo); if (ret) { gf_log ("", GF_LOG_DEBUG, "Unable to mkdir " "mountpoint"); goto out; } ret = rb_spawn_glusterfs_client (volinfo, src_brickinfo); if (ret) { gf_log ("", GF_LOG_DEBUG, "Unable to start glusterfs"); goto out; } ret = 0; out: return ret; } static int rb_spawn_destination_brick (glusterd_volinfo_t *volinfo, glusterd_brickinfo_t *dst_brickinfo) { int ret = -1; ret = rb_generate_dst_brick_volfile (volinfo, dst_brickinfo); if (ret) { gf_log ("", GF_LOG_DEBUG, "Unable to generate client " "volfile"); goto out; } ret = rb_spawn_dst_brick (volinfo, dst_brickinfo); if (ret) { gf_log ("", GF_LOG_DEBUG, "Unable to start glusterfs"); goto out; } ret = 0; out: return ret; } static int rb_kill_destination_brick (glusterd_volinfo_t *volinfo, glusterd_brickinfo_t *dst_brickinfo) { glusterd_conf_t *priv = NULL; char pidfile[PATH_MAX] = {0,}; priv = THIS->private; snprintf (pidfile, PATH_MAX, "%s/vols/%s/%s", priv->workdir, volinfo->volname, RB_DSTBRICK_PIDFILE); return glusterd_service_stop ("brick", pidfile, SIGTERM, _gf_true); } static int rb_get_xattr_command (glusterd_volinfo_t *volinfo, glusterd_brickinfo_t *src_brickinfo, glusterd_brickinfo_t *dst_brickinfo, const char *xattr_key, char *value) { glusterd_conf_t *priv = NULL; xlator_t *this = NULL; char mount_point_path[PATH_MAX] = {0,}; int ret = -1; this = THIS; priv = THIS->private; snprintf (mount_point_path, PATH_MAX, "%s/vols/%s/%s", priv->workdir, volinfo->volname, RB_CLIENT_MOUNTPOINT); ret = sys_lgetxattr (mount_point_path, xattr_key, value, 8192); if (ret < 0) { gf_log (this->name, GF_LOG_DEBUG, "getxattr on key: %s " "failed", xattr_key); goto out; } ret = 0; out: return ret; } static int rb_send_cmd (glusterd_volinfo_t *volinfo, glusterd_brickinfo_t *src, glusterd_brickinfo_t *dst, gf1_cli_replace_op op) { char start_value[8192] = {0,}; char status[8192] = {0,}; char *status_reply = NULL; dict_t *ctx = NULL; int ret = 0; GF_ASSERT (volinfo); GF_ASSERT (src); GF_ASSERT (dst); GF_ASSERT ((op > GF_REPLACE_OP_NONE) && (op <= GF_REPLACE_OP_COMMIT_FORCE)); switch (op) { case GF_REPLACE_OP_START: { snprintf (start_value, sizeof (start_value), "%s:%s:%d", dst->hostname, dst->path, dst->port); ret = rb_send_xattr_command (volinfo, src, dst, RB_PUMP_CMD_START, start_value); } break; case GF_REPLACE_OP_PAUSE: { ret = rb_send_xattr_command (volinfo, src, dst, RB_PUMP_CMD_PAUSE, RB_PUMP_DEF_ARG); } break; case GF_REPLACE_OP_ABORT: { ret = rb_send_xattr_command (volinfo, src, dst, RB_PUMP_CMD_ABORT, RB_PUMP_DEF_ARG); } break; case GF_REPLACE_OP_COMMIT: { ret = rb_send_xattr_command (volinfo, src, dst, RB_PUMP_CMD_COMMIT, RB_PUMP_DEF_ARG); } break; case GF_REPLACE_OP_STATUS: { ret = rb_get_xattr_command (volinfo, src, dst, RB_PUMP_CMD_STATUS, status); if (ret) goto out; ctx = glusterd_op_get_ctx (); GF_ASSERT (ctx); if (!ctx) { ret = -1; gf_log (THIS->name, GF_LOG_CRITICAL, "ctx is not present."); goto out; } status_reply = gf_strdup (status); ret = dict_set_dynstr (ctx, "status-reply", status_reply); if (ret) { GF_FREE (status_reply); gf_log (THIS->name, GF_LOG_ERROR, "Couldn't " "set rb status response in context."); goto out; } } break; default: { GF_ASSERT (0); ret = -1; gf_log (THIS->name, GF_LOG_CRITICAL, "Invalid replace" " brick subcommand."); } break; } out: return ret; } static int rb_do_operation (glusterd_volinfo_t *volinfo, glusterd_brickinfo_t *src_brickinfo, glusterd_brickinfo_t *dst_brickinfo, gf1_cli_replace_op op) { int ret = -1; char op_str[256] = {0, }; xlator_t *this = NULL; this = THIS; ret = rb_spawn_maintenance_client (volinfo, src_brickinfo); if (ret) { gf_log (this->name, GF_LOG_DEBUG, "Could not spawn " "maintenance client"); goto umount; } ret = rb_send_cmd (volinfo, src_brickinfo, dst_brickinfo, op); if (ret) { (void) glusterd_get_replace_op_str (op, op_str); gf_log (this->name, GF_LOG_DEBUG, "Sending replace-brick " "sub-command %s failed.", op_str); } umount: if (rb_destroy_maintenance_client (volinfo, src_brickinfo)) gf_log (this->name, GF_LOG_DEBUG, "Failed to destroy " "maintenance client"); return ret; } /* Set src-brick's port number to be used in the maintenance mount * after all commit acks are received. */ static int rb_update_srcbri