summaryrefslogtreecommitdiffstats
path: root/glusterfsd
diff options
context:
space:
mode:
Diffstat (limited to 'glusterfsd')
-rw-r--r--glusterfsd/src/glusterfsd-mgmt.c15
-rw-r--r--glusterfsd/src/glusterfsd.c2
-rw-r--r--glusterfsd/src/glusterfsd.h2
3 files changed, 13 insertions, 6 deletions
diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c
index 57f8dc0405c..6871582abb0 100644
--- a/glusterfsd/src/glusterfsd-mgmt.c
+++ b/glusterfsd/src/glusterfsd-mgmt.c
@@ -234,6 +234,7 @@ glusterfs_handle_terminate (rpcsvc_request_t *req)
gf_log (THIS->name, GF_LOG_INFO,
"terminating after loss of last child %s",
xlator_req.name);
+ glusterfs_mgmt_pmap_signout (glusterfsd_ctx, xlator_req.name);
cleanup_and_exit (SIGTERM);
} else {
/*
@@ -246,6 +247,8 @@ glusterfs_handle_terminate (rpcsvc_request_t *req)
gf_log (THIS->name, GF_LOG_INFO, "detaching not-only child %s",
xlator_req.name);
top->notify (top, GF_EVENT_TRANSPORT_CLEANUP, victim);
+ glusterfs_mgmt_pmap_signout (glusterfsd_ctx, xlator_req.name);
+
*trav_p = (*trav_p)->next;
glusterfs_autoscale_threads (THIS->ctx, -1);
}
@@ -2563,7 +2566,7 @@ out:
int
-glusterfs_mgmt_pmap_signout (glusterfs_ctx_t *ctx)
+glusterfs_mgmt_pmap_signout (glusterfs_ctx_t *ctx, char *brickname)
{
int ret = 0;
pmap_signout_req req = {0, };
@@ -2574,7 +2577,7 @@ glusterfs_mgmt_pmap_signout (glusterfs_ctx_t *ctx)
frame = create_frame (THIS, ctx->pool);
cmd_args = &ctx->cmd_args;
- if (!cmd_args->brick_port || !cmd_args->brick_name) {
+ if (!cmd_args->brick_port && (!cmd_args->brick_name || !brickname)) {
gf_log ("fsd-mgmt", GF_LOG_DEBUG,
"portmapper signout arguments not given");
goto out;
@@ -2585,8 +2588,12 @@ glusterfs_mgmt_pmap_signout (glusterfs_ctx_t *ctx)
snprintf (brick_name, sizeof(brick_name), "%s.rdma",
cmd_args->brick_name);
req.brick = brick_name;
- } else
- req.brick = cmd_args->brick_name;
+ } else {
+ if (brickname)
+ req.brick = brickname;
+ else
+ req.brick = cmd_args->brick_name;
+ }
req.port = cmd_args->brick_port;
req.rdma_port = cmd_args->brick_port2;
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c
index f402246e78e..e3699739c07 100644
--- a/glusterfsd/src/glusterfsd.c
+++ b/glusterfsd/src/glusterfsd.c
@@ -1332,7 +1332,7 @@ cleanup_and_exit (int signum)
return;
ctx->cleanup_started = 1;
- glusterfs_mgmt_pmap_signout (ctx);
+ glusterfs_mgmt_pmap_signout (ctx, NULL);
/* below part is a racy code where the rpcsvc object is freed.
* But in another thread (epoll thread), upon poll error in the
diff --git a/glusterfsd/src/glusterfsd.h b/glusterfsd/src/glusterfsd.h
index e442bede5db..6a30ee9e3f7 100644
--- a/glusterfsd/src/glusterfsd.h
+++ b/glusterfsd/src/glusterfsd.h
@@ -109,7 +109,7 @@ struct _gfd_vol_top_priv_t {
};
typedef struct _gfd_vol_top_priv_t gfd_vol_top_priv_t;
-int glusterfs_mgmt_pmap_signout (glusterfs_ctx_t *ctx);
+int glusterfs_mgmt_pmap_signout (glusterfs_ctx_t *ctx, char *brick_name);
int glusterfs_mgmt_pmap_signin (glusterfs_ctx_t *ctx);
int glusterfs_volfile_fetch (glusterfs_ctx_t *ctx);
void cleanup_and_exit (int signum);