17b94a
From b0815b8a84a07d17a1215c55afc38888ee9fc37c Mon Sep 17 00:00:00 2001
17b94a
From: Mohammed Rafi KC <rkavunga@redhat.com>
17b94a
Date: Mon, 24 Jun 2019 12:00:20 +0530
17b94a
Subject: [PATCH 227/255] glusterd/svc: update pid of mux volumes from the shd
17b94a
 process
17b94a
17b94a
For a normal volume, we are updating the pid from a the
17b94a
process while we do a daemonization or at the end of the
17b94a
init if it is no-daemon mode. Along with updating the pid
17b94a
we also lock the file, to make sure that the process is
17b94a
running fine.
17b94a
17b94a
With brick mux, we were updating the pidfile from gluterd
17b94a
after an attach/detach request.
17b94a
17b94a
There are two problems with this approach.
17b94a
1) We are not holding a pidlock for any file other than parent
17b94a
   process.
17b94a
2) There is a chance for possible race conditions with attach/detach.
17b94a
   For example, shd start and a volume stop could race. Let's say
17b94a
   we are starting an shd and it is attached to a volume.
17b94a
   While we trying to link the pid file to the running process,
17b94a
   this would have deleted by the thread that doing a volume stop.
17b94a
17b94a
> upstream patch : https://review.gluster.org/#/c/glusterfs/+/22935/
17b94a
17b94a
>Change-Id: I29a00352102877ce09ea3f376ca52affceb5cf1a
17b94a
>Updates: bz#1722541
17b94a
>Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
17b94a
17b94a
Change-Id: I29a00352102877ce09ea3f376ca52affceb5cf1a
17b94a
BUG: 1721802
17b94a
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
17b94a
Reviewed-on: https://code.engineering.redhat.com/gerrit/175723
17b94a
Tested-by: RHGS Build Bot <nigelb@redhat.com>
17b94a
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
17b94a
---
17b94a
 glusterfsd/src/gf_attach.c                         |   2 +
17b94a
 glusterfsd/src/glusterfsd-mgmt.c                   |  66 +++++++--
17b94a
 libglusterfs/src/glusterfs/glusterfs.h             |   2 +-
17b94a
 libglusterfs/src/glusterfs/libglusterfs-messages.h |   3 +-
17b94a
 libglusterfs/src/graph.c                           | 154 ++++++++++++++++++++-
17b94a
 rpc/xdr/src/glusterd1-xdr.x                        |   1 +
17b94a
 xlators/mgmt/glusterd/src/glusterd-handler.c       |   2 +
17b94a
 xlators/mgmt/glusterd/src/glusterd-handshake.c     |  42 +++++-
17b94a
 xlators/mgmt/glusterd/src/glusterd-op-sm.c         |   4 +
17b94a
 .../mgmt/glusterd/src/glusterd-shd-svc-helper.c    |  25 ++++
17b94a
 .../mgmt/glusterd/src/glusterd-shd-svc-helper.h    |   3 +
17b94a
 xlators/mgmt/glusterd/src/glusterd-shd-svc.c       |   8 +-
17b94a
 xlators/mgmt/glusterd/src/glusterd-svc-helper.c    |  57 ++++----
17b94a
 xlators/mgmt/glusterd/src/glusterd-syncop.c        |   2 +
17b94a
 xlators/mgmt/glusterd/src/glusterd-utils.c         |   6 +-
17b94a
 15 files changed, 325 insertions(+), 52 deletions(-)
17b94a
17b94a
diff --git a/glusterfsd/src/gf_attach.c b/glusterfsd/src/gf_attach.c
17b94a
index 6293b9b..1bff854 100644
17b94a
--- a/glusterfsd/src/gf_attach.c
17b94a
+++ b/glusterfsd/src/gf_attach.c
17b94a
@@ -65,6 +65,8 @@ send_brick_req(xlator_t *this, struct rpc_clnt *rpc, char *path, int op)
17b94a
     brick_req.name = path;
17b94a
     brick_req.input.input_val = NULL;
17b94a
     brick_req.input.input_len = 0;
17b94a
+    brick_req.dict.dict_val = NULL;
17b94a
+    brick_req.dict.dict_len = 0;
17b94a
 
17b94a
     req_size = xdr_sizeof((xdrproc_t)xdr_gd1_mgmt_brick_op_req, req);
17b94a
     iobuf = iobuf_get2(rpc->ctx->iobuf_pool, req_size);
17b94a
diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c
17b94a
index 1d2cd1a..f930e0a 100644
17b94a
--- a/glusterfsd/src/glusterfsd-mgmt.c
17b94a
+++ b/glusterfsd/src/glusterfsd-mgmt.c
17b94a
@@ -50,13 +50,16 @@ int
17b94a
 emancipate(glusterfs_ctx_t *ctx, int ret);
17b94a
 int
17b94a
 glusterfs_process_svc_attach_volfp(glusterfs_ctx_t *ctx, FILE *fp,
17b94a
-                                   char *volfile_id, char *checksum);
17b94a
+                                   char *volfile_id, char *checksum,
17b94a
+                                   dict_t *dict);
17b94a
 int
17b94a
 glusterfs_mux_volfile_reconfigure(FILE *newvolfile_fp, glusterfs_ctx_t *ctx,
17b94a
-                                  gf_volfile_t *volfile_obj, char *checksum);
17b94a
+                                  gf_volfile_t *volfile_obj, char *checksum,
17b94a
+                                  dict_t *dict);
17b94a
 int
17b94a
 glusterfs_process_svc_attach_volfp(glusterfs_ctx_t *ctx, FILE *fp,
17b94a
-                                   char *volfile_id, char *checksum);
17b94a
+                                   char *volfile_id, char *checksum,
17b94a
+                                   dict_t *dict);
17b94a
 int
17b94a
 glusterfs_process_svc_detach(glusterfs_ctx_t *ctx, gf_volfile_t *volfile_obj);
17b94a
 
17b94a
@@ -75,7 +78,8 @@ mgmt_cbk_spec(struct rpc_clnt *rpc, void *mydata, void *data)
17b94a
 }
17b94a
 
17b94a
 int
17b94a
-mgmt_process_volfile(const char *volfile, ssize_t size, char *volfile_id)
17b94a
+mgmt_process_volfile(const char *volfile, ssize_t size, char *volfile_id,
17b94a
+                     dict_t *dict)
17b94a
 {
17b94a
     glusterfs_ctx_t *ctx = NULL;
17b94a
     int ret = 0;
17b94a
@@ -145,11 +149,11 @@ mgmt_process_volfile(const char *volfile, ssize_t size, char *volfile_id)
17b94a
              * the volfile
17b94a
              */
17b94a
             ret = glusterfs_process_svc_attach_volfp(ctx, tmpfp, volfile_id,
17b94a
-                                                     sha256_hash);
17b94a
+                                                     sha256_hash, dict);
17b94a
             goto unlock;
17b94a
         }
17b94a
         ret = glusterfs_mux_volfile_reconfigure(tmpfp, ctx, volfile_obj,
17b94a
-                                                sha256_hash);
17b94a
+                                                sha256_hash, dict);
17b94a
         if (ret < 0) {
17b94a
             gf_msg_debug("glusterfsd-mgmt", EINVAL, "Reconfigure failed !!");
17b94a
         }
17b94a
@@ -387,6 +391,8 @@ err:
17b94a
         UNLOCK(&ctx->volfile_lock);
17b94a
     if (xlator_req.input.input_val)
17b94a
         free(xlator_req.input.input_val);
17b94a
+    if (xlator_req.dict.dict_val)
17b94a
+        free(xlator_req.dict.dict_val);
17b94a
     free(xlator_req.name);
17b94a
     xlator_req.name = NULL;
17b94a
     return 0;
17b94a
@@ -561,6 +567,8 @@ out:
17b94a
 
17b94a
     free(xlator_req.name);
17b94a
     free(xlator_req.input.input_val);
17b94a
+    if (xlator_req.dict.dict_val)
17b94a
+        free(xlator_req.dict.dict_val);
17b94a
     if (output)
17b94a
         dict_unref(output);
17b94a
     if (dict)
17b94a
@@ -982,6 +990,8 @@ out:
17b94a
     if (input)
17b94a
         dict_unref(input);
17b94a
     free(xlator_req.input.input_val); /*malloced by xdr*/
17b94a
+    if (xlator_req.dict.dict_val)
17b94a
+        free(xlator_req.dict.dict_val);
17b94a
     if (output)
17b94a
         dict_unref(output);
17b94a
     free(xlator_req.name);
17b94a
@@ -1062,6 +1072,8 @@ glusterfs_handle_attach(rpcsvc_request_t *req)
17b94a
     out:
17b94a
         UNLOCK(&ctx->volfile_lock);
17b94a
     }
17b94a
+    if (xlator_req.dict.dict_val)
17b94a
+        free(xlator_req.dict.dict_val);
17b94a
     free(xlator_req.input.input_val);
17b94a
     free(xlator_req.name);
17b94a
 
17b94a
@@ -1077,6 +1089,7 @@ glusterfs_handle_svc_attach(rpcsvc_request_t *req)
17b94a
     };
17b94a
     xlator_t *this = NULL;
17b94a
     glusterfs_ctx_t *ctx = NULL;
17b94a
+    dict_t *dict = NULL;
17b94a
 
17b94a
     GF_ASSERT(req);
17b94a
     this = THIS;
17b94a
@@ -1091,20 +1104,41 @@ glusterfs_handle_svc_attach(rpcsvc_request_t *req)
17b94a
         req->rpc_err = GARBAGE_ARGS;
17b94a
         goto out;
17b94a
     }
17b94a
+
17b94a
     gf_msg(THIS->name, GF_LOG_INFO, 0, glusterfsd_msg_41,
17b94a
            "received attach "
17b94a
            "request for volfile-id=%s",
17b94a
            xlator_req.name);
17b94a
+
17b94a
+    dict = dict_new();
17b94a
+    if (!dict) {
17b94a
+        ret = -1;
17b94a
+        errno = ENOMEM;
17b94a
+        goto out;
17b94a
+    }
17b94a
+
17b94a
+    ret = dict_unserialize(xlator_req.dict.dict_val, xlator_req.dict.dict_len,
17b94a
+                           &dict);
17b94a
+    if (ret) {
17b94a
+        gf_msg(this->name, GF_LOG_WARNING, EINVAL, glusterfsd_msg_42,
17b94a
+               "failed to unserialize xdata to dictionary");
17b94a
+        goto out;
17b94a
+    }
17b94a
+    dict->extra_stdfree = xlator_req.dict.dict_val;
17b94a
+
17b94a
     ret = 0;
17b94a
 
17b94a
     if (ctx->active) {
17b94a
         ret = mgmt_process_volfile(xlator_req.input.input_val,
17b94a
-                                   xlator_req.input.input_len, xlator_req.name);
17b94a
+                                   xlator_req.input.input_len, xlator_req.name,
17b94a
+                                   dict);
17b94a
     } else {
17b94a
         gf_msg(this->name, GF_LOG_WARNING, EINVAL, glusterfsd_msg_42,
17b94a
                "got attach for %s but no active graph", xlator_req.name);
17b94a
     }
17b94a
 out:
17b94a
+    if (dict)
17b94a
+        dict_unref(dict);
17b94a
     if (xlator_req.input.input_val)
17b94a
         free(xlator_req.input.input_val);
17b94a
     if (xlator_req.name)
17b94a
@@ -1241,6 +1275,8 @@ out:
17b94a
     GF_FREE(filepath);
17b94a
     if (xlator_req.input.input_val)
17b94a
         free(xlator_req.input.input_val);
17b94a
+    if (xlator_req.dict.dict_val)
17b94a
+        free(xlator_req.dict.dict_val);
17b94a
 
17b94a
     return ret;
17b94a
 }
17b94a
@@ -1313,6 +1349,8 @@ out:
17b94a
     if (dict)
17b94a
         dict_unref(dict);
17b94a
     free(xlator_req.input.input_val);  // malloced by xdr
17b94a
+    if (xlator_req.dict.dict_val)
17b94a
+        free(xlator_req.dict.dict_val);
17b94a
     if (output)
17b94a
         dict_unref(output);
17b94a
     free(xlator_req.name);  // malloced by xdr
17b94a
@@ -1461,6 +1499,8 @@ out:
17b94a
     if (output)
17b94a
         dict_unref(output);
17b94a
     free(brick_req.input.input_val);
17b94a
+    if (brick_req.dict.dict_val)
17b94a
+        free(brick_req.dict.dict_val);
17b94a
     free(brick_req.name);
17b94a
     GF_FREE(xname);
17b94a
     GF_FREE(msg);
17b94a
@@ -1654,6 +1694,8 @@ out:
17b94a
     if (dict)
17b94a
         dict_unref(dict);
17b94a
     free(node_req.input.input_val);
17b94a
+    if (node_req.dict.dict_val)
17b94a
+        free(node_req.dict.dict_val);
17b94a
     GF_FREE(msg);
17b94a
     GF_FREE(rsp.output.output_val);
17b94a
     GF_FREE(node_name);
17b94a
@@ -1757,6 +1799,8 @@ glusterfs_handle_nfs_profile(rpcsvc_request_t *req)
17b94a
 
17b94a
 out:
17b94a
     free(nfs_req.input.input_val);
17b94a
+    if (nfs_req.dict.dict_val)
17b94a
+        free(nfs_req.dict.dict_val);
17b94a
     if (dict)
17b94a
         dict_unref(dict);
17b94a
     if (output)
17b94a
@@ -1835,6 +1879,8 @@ out:
17b94a
     if (dict)
17b94a
         dict_unref(dict);
17b94a
     free(xlator_req.input.input_val);  // malloced by xdr
17b94a
+    if (xlator_req.dict.dict_val)
17b94a
+        free(xlator_req.dict.dict_val);
17b94a
     if (output)
17b94a
         dict_unref(output);
17b94a
     free(xlator_req.name);  // malloced by xdr
17b94a
@@ -1963,7 +2009,8 @@ out:
17b94a
     if (dict)
17b94a
         dict_unref(dict);
17b94a
     free(brick_req.input.input_val);
17b94a
-
17b94a
+    if (brick_req.dict.dict_val)
17b94a
+        free(brick_req.dict.dict_val);
17b94a
     gf_log(THIS->name, GF_LOG_DEBUG, "Returning %d", ret);
17b94a
     return ret;
17b94a
 }
17b94a
@@ -2213,7 +2260,8 @@ volfile:
17b94a
     size = rsp.op_ret;
17b94a
     volfile_id = frame->local;
17b94a
     if (mgmt_is_multiplexed_daemon(ctx->cmd_args.process_name)) {
17b94a
-        ret = mgmt_process_volfile((const char *)rsp.spec, size, volfile_id);
17b94a
+        ret = mgmt_process_volfile((const char *)rsp.spec, size, volfile_id,
17b94a
+                                   dict);
17b94a
         goto post_graph_mgmt;
17b94a
     }
17b94a
 
17b94a
diff --git a/libglusterfs/src/glusterfs/glusterfs.h b/libglusterfs/src/glusterfs/glusterfs.h
17b94a
index 9ec2365..b6327b8 100644
17b94a
--- a/libglusterfs/src/glusterfs/glusterfs.h
17b94a
+++ b/libglusterfs/src/glusterfs/glusterfs.h
17b94a
@@ -744,7 +744,7 @@ typedef struct {
17b94a
     char vol_id[NAME_MAX + 1];
17b94a
     struct list_head volfile_list;
17b94a
     glusterfs_graph_t *graph;
17b94a
-
17b94a
+    FILE *pidfp;
17b94a
 } gf_volfile_t;
17b94a
 
17b94a
 glusterfs_ctx_t *
17b94a
diff --git a/libglusterfs/src/glusterfs/libglusterfs-messages.h b/libglusterfs/src/glusterfs/libglusterfs-messages.h
17b94a
index ea2aa60..7e0eebb 100644
17b94a
--- a/libglusterfs/src/glusterfs/libglusterfs-messages.h
17b94a
+++ b/libglusterfs/src/glusterfs/libglusterfs-messages.h
17b94a
@@ -111,6 +111,7 @@ GLFS_MSGID(
17b94a
     LG_MSG_PTHREAD_NAMING_FAILED, LG_MSG_SYSCALL_RETURNS_WRONG,
17b94a
     LG_MSG_XXH64_TO_GFID_FAILED, LG_MSG_ASYNC_WARNING, LG_MSG_ASYNC_FAILURE,
17b94a
     LG_MSG_GRAPH_CLEANUP_FAILED, LG_MSG_GRAPH_SETUP_FAILED,
17b94a
-    LG_MSG_GRAPH_DETACH_STARTED, LG_MSG_GRAPH_ATTACH_FAILED);
17b94a
+    LG_MSG_GRAPH_DETACH_STARTED, LG_MSG_GRAPH_ATTACH_FAILED,
17b94a
+    LG_MSG_GRAPH_ATTACH_PID_FILE_UPDATED);
17b94a
 
17b94a
 #endif /* !_LG_MESSAGES_H_ */
17b94a
diff --git a/libglusterfs/src/graph.c b/libglusterfs/src/graph.c
17b94a
index 172dc61..05f76bf 100644
17b94a
--- a/libglusterfs/src/graph.c
17b94a
+++ b/libglusterfs/src/graph.c
17b94a
@@ -1467,6 +1467,21 @@ out:
17b94a
 }
17b94a
 
17b94a
 int
17b94a
+glusterfs_svc_mux_pidfile_cleanup(gf_volfile_t *volfile_obj)
17b94a
+{
17b94a
+    if (!volfile_obj || !volfile_obj->pidfp)
17b94a
+        return 0;
17b94a
+
17b94a
+    gf_msg_trace("glusterfsd", 0, "pidfile %s cleanup", volfile_obj->vol_id);
17b94a
+
17b94a
+    lockf(fileno(volfile_obj->pidfp), F_ULOCK, 0);
17b94a
+    fclose(volfile_obj->pidfp);
17b94a
+    volfile_obj->pidfp = NULL;
17b94a
+
17b94a
+    return 0;
17b94a
+}
17b94a
+
17b94a
+int
17b94a
 glusterfs_process_svc_detach(glusterfs_ctx_t *ctx, gf_volfile_t *volfile_obj)
17b94a
 {
17b94a
     xlator_t *last_xl = NULL;
17b94a
@@ -1502,6 +1517,7 @@ glusterfs_process_svc_detach(glusterfs_ctx_t *ctx, gf_volfile_t *volfile_obj)
17b94a
 
17b94a
         list_del_init(&volfile_obj->volfile_list);
17b94a
         glusterfs_mux_xlator_unlink(parent_graph->top, xl);
17b94a
+        glusterfs_svc_mux_pidfile_cleanup(volfile_obj);
17b94a
         parent_graph->last_xl = glusterfs_get_last_xlator(parent_graph);
17b94a
         parent_graph->xl_count -= graph->xl_count;
17b94a
         parent_graph->leaf_count -= graph->leaf_count;
17b94a
@@ -1531,8 +1547,126 @@ out:
17b94a
 }
17b94a
 
17b94a
 int
17b94a
+glusterfs_svc_mux_pidfile_setup(gf_volfile_t *volfile_obj, const char *pid_file)
17b94a
+{
17b94a
+    int ret = -1;
17b94a
+    FILE *pidfp = NULL;
17b94a
+
17b94a
+    if (!pid_file || !volfile_obj)
17b94a
+        goto out;
17b94a
+
17b94a
+    if (volfile_obj->pidfp) {
17b94a
+        ret = 0;
17b94a
+        goto out;
17b94a
+    }
17b94a
+    pidfp = fopen(pid_file, "a+");
17b94a
+    if (!pidfp) {
17b94a
+        goto out;
17b94a
+    }
17b94a
+    volfile_obj->pidfp = pidfp;
17b94a
+
17b94a
+    ret = lockf(fileno(pidfp), F_TLOCK, 0);
17b94a
+    if (ret) {
17b94a
+        ret = 0;
17b94a
+        goto out;
17b94a
+    }
17b94a
+out:
17b94a
+    return ret;
17b94a
+}
17b94a
+
17b94a
+int
17b94a
+glusterfs_svc_mux_pidfile_update(gf_volfile_t *volfile_obj,
17b94a
+                                 const char *pid_file, pid_t pid)
17b94a
+{
17b94a
+    int ret = 0;
17b94a
+    FILE *pidfp = NULL;
17b94a
+    int old_pid;
17b94a
+
17b94a
+    if (!volfile_obj->pidfp) {
17b94a
+        ret = glusterfs_svc_mux_pidfile_setup(volfile_obj, pid_file);
17b94a
+        if (ret == -1)
17b94a
+            goto out;
17b94a
+    }
17b94a
+    pidfp = volfile_obj->pidfp;
17b94a
+    ret = fscanf(pidfp, "%d", &old_pid);
17b94a
+    if (ret <= 0) {
17b94a
+        goto update;
17b94a
+    }
17b94a
+    if (old_pid == pid) {
17b94a
+        ret = 0;
17b94a
+        goto out;
17b94a
+    } else {
17b94a
+        gf_msg("mgmt", GF_LOG_INFO, 0, LG_MSG_GRAPH_ATTACH_PID_FILE_UPDATED,
17b94a
+               "Old pid=%d found in pidfile %s. Cleaning the old pid and "
17b94a
+               "Updating new pid=%d",
17b94a
+               old_pid, pid_file, pid);
17b94a
+    }
17b94a
+update:
17b94a
+    ret = sys_ftruncate(fileno(pidfp), 0);
17b94a
+    if (ret) {
17b94a
+        gf_msg("glusterfsd", GF_LOG_ERROR, errno,
17b94a
+               LG_MSG_GRAPH_ATTACH_PID_FILE_UPDATED,
17b94a
+               "pidfile %s truncation failed", pid_file);
17b94a
+        goto out;
17b94a
+    }
17b94a
+
17b94a
+    ret = fprintf(pidfp, "%d\n", pid);
17b94a
+    if (ret <= 0) {
17b94a
+        gf_msg("glusterfsd", GF_LOG_ERROR, errno,
17b94a
+               LG_MSG_GRAPH_ATTACH_PID_FILE_UPDATED, "pidfile %s write failed",
17b94a
+               pid_file);
17b94a
+        goto out;
17b94a
+    }
17b94a
+
17b94a
+    ret = fflush(pidfp);
17b94a
+    if (ret) {
17b94a
+        gf_msg("glusterfsd", GF_LOG_ERROR, errno,
17b94a
+               LG_MSG_GRAPH_ATTACH_PID_FILE_UPDATED, "pidfile %s write failed",
17b94a
+               pid_file);
17b94a
+        goto out;
17b94a
+    }
17b94a
+out:
17b94a
+    return ret;
17b94a
+}
17b94a
+
17b94a
+int
17b94a
+glusterfs_update_mux_pid(dict_t *dict, gf_volfile_t *volfile_obj)
17b94a
+{
17b94a
+    char *file = NULL;
17b94a
+    int ret = -1;
17b94a
+
17b94a
+    GF_VALIDATE_OR_GOTO("graph", dict, out);
17b94a
+    GF_VALIDATE_OR_GOTO("graph", volfile_obj, out);
17b94a
+
17b94a
+    ret = dict_get_str(dict, "pidfile", &file;;
17b94a
+    if (ret < 0) {
17b94a
+        gf_msg("mgmt", GF_LOG_ERROR, EINVAL, LG_MSG_GRAPH_SETUP_FAILED,
17b94a
+               "Failed to get pidfile from dict for  volfile_id=%s",
17b94a
+               volfile_obj->vol_id);
17b94a
+    }
17b94a
+
17b94a
+    ret = glusterfs_svc_mux_pidfile_update(volfile_obj, file, getpid());
17b94a
+    if (ret < 0) {
17b94a
+        ret = -1;
17b94a
+        gf_msg("mgmt", GF_LOG_ERROR, EINVAL, LG_MSG_GRAPH_SETUP_FAILED,
17b94a
+               "Failed to update "
17b94a
+               "the pidfile for volfile_id=%s",
17b94a
+               volfile_obj->vol_id);
17b94a
+
17b94a
+        goto out;
17b94a
+    }
17b94a
+
17b94a
+    if (ret == 1)
17b94a
+        gf_msg("mgmt", GF_LOG_INFO, 0, LG_MSG_GRAPH_ATTACH_PID_FILE_UPDATED,
17b94a
+               "PID %d updated in pidfile=%s", getpid(), file);
17b94a
+    ret = 0;
17b94a
+out:
17b94a
+    return ret;
17b94a
+}
17b94a
+int
17b94a
 glusterfs_process_svc_attach_volfp(glusterfs_ctx_t *ctx, FILE *fp,
17b94a
-                                   char *volfile_id, char *checksum)
17b94a
+                                   char *volfile_id, char *checksum,
17b94a
+                                   dict_t *dict)
17b94a
 {
17b94a
     glusterfs_graph_t *graph = NULL;
17b94a
     glusterfs_graph_t *parent_graph = NULL;
17b94a
@@ -1615,18 +1749,25 @@ glusterfs_process_svc_attach_volfp(glusterfs_ctx_t *ctx, FILE *fp,
17b94a
         ret = -1;
17b94a
         goto out;
17b94a
     }
17b94a
+    volfile_obj->pidfp = NULL;
17b94a
+    snprintf(volfile_obj->vol_id, sizeof(volfile_obj->vol_id), "%s",
17b94a
+             volfile_id);
17b94a
+
17b94a
+    if (strcmp(ctx->cmd_args.process_name, "glustershd") == 0) {
17b94a
+        ret = glusterfs_update_mux_pid(dict, volfile_obj);
17b94a
+        if (ret == -1) {
17b94a
+            goto out;
17b94a
+        }
17b94a
+    }
17b94a
 
17b94a
     graph->used = 1;
17b94a
     parent_graph->id++;
17b94a
     list_add(&graph->list, &ctx->graphs);
17b94a
     INIT_LIST_HEAD(&volfile_obj->volfile_list);
17b94a
     volfile_obj->graph = graph;
17b94a
-    snprintf(volfile_obj->vol_id, sizeof(volfile_obj->vol_id), "%s",
17b94a
-             volfile_id);
17b94a
     memcpy(volfile_obj->volfile_checksum, checksum,
17b94a
            sizeof(volfile_obj->volfile_checksum));
17b94a
     list_add_tail(&volfile_obj->volfile_list, &ctx->volfile_list);
17b94a
-
17b94a
     gf_log_dump_graph(fp, graph);
17b94a
     graph = NULL;
17b94a
 
17b94a
@@ -1654,7 +1795,8 @@ out:
17b94a
 
17b94a
 int
17b94a
 glusterfs_mux_volfile_reconfigure(FILE *newvolfile_fp, glusterfs_ctx_t *ctx,
17b94a
-                                  gf_volfile_t *volfile_obj, char *checksum)
17b94a
+                                  gf_volfile_t *volfile_obj, char *checksum,
17b94a
+                                  dict_t *dict)
17b94a
 {
17b94a
     glusterfs_graph_t *oldvolfile_graph = NULL;
17b94a
     glusterfs_graph_t *newvolfile_graph = NULL;
17b94a
@@ -1703,7 +1845,7 @@ glusterfs_mux_volfile_reconfigure(FILE *newvolfile_fp, glusterfs_ctx_t *ctx,
17b94a
         }
17b94a
         volfile_obj = NULL;
17b94a
         ret = glusterfs_process_svc_attach_volfp(ctx, newvolfile_fp, vol_id,
17b94a
-                                                 checksum);
17b94a
+                                                 checksum, dict);
17b94a
         goto out;
17b94a
     }
17b94a
 
17b94a
diff --git a/rpc/xdr/src/glusterd1-xdr.x b/rpc/xdr/src/glusterd1-xdr.x
17b94a
index 9b36d34..02ebec2 100644
17b94a
--- a/rpc/xdr/src/glusterd1-xdr.x
17b94a
+++ b/rpc/xdr/src/glusterd1-xdr.x
17b94a
@@ -132,6 +132,7 @@ struct gd1_mgmt_brick_op_req {
17b94a
         string  name<>;
17b94a
         int     op;
17b94a
         opaque  input<>;
17b94a
+        opaque  dict<>;
17b94a
 } ;
17b94a
 
17b94a
 struct gd1_mgmt_brick_op_rsp {
17b94a
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
17b94a
index af8a8a4..cc1f1df 100644
17b94a
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
17b94a
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
17b94a
@@ -5423,6 +5423,8 @@ glusterd_print_client_details(FILE *fp, dict_t *dict,
17b94a
 
17b94a
     brick_req->op = GLUSTERD_BRICK_STATUS;
17b94a
     brick_req->name = "";
17b94a
+    brick_req->dict.dict_val = NULL;
17b94a
+    brick_req->dict.dict_len = 0;
17b94a
 
17b94a
     ret = dict_set_strn(dict, "brick-name", SLEN("brick-name"),
17b94a
                         brickinfo->path);
17b94a
diff --git a/xlators/mgmt/glusterd/src/glusterd-handshake.c b/xlators/mgmt/glusterd/src/glusterd-handshake.c
17b94a
index 1ba58c3..86dec82 100644
17b94a
--- a/xlators/mgmt/glusterd/src/glusterd-handshake.c
17b94a
+++ b/xlators/mgmt/glusterd/src/glusterd-handshake.c
17b94a
@@ -203,7 +203,7 @@ out:
17b94a
 
17b94a
 size_t
17b94a
 build_volfile_path(char *volume_id, char *path, size_t path_len,
17b94a
-                   char *trusted_str)
17b94a
+                   char *trusted_str, dict_t *dict)
17b94a
 {
17b94a
     struct stat stbuf = {
17b94a
         0,
17b94a
@@ -340,11 +340,19 @@ build_volfile_path(char *volume_id, char *path, size_t path_len,
17b94a
 
17b94a
         ret = glusterd_volinfo_find(volid_ptr, &volinfo);
17b94a
         if (ret == -1) {
17b94a
-            gf_log(this->name, GF_LOG_ERROR, "Couldn't find volinfo");
17b94a
+            gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_VOLINFO_GET_FAIL,
17b94a
+                   "Couldn't find volinfo for volid=%s", volid_ptr);
17b94a
             goto out;
17b94a
         }
17b94a
 
17b94a
         glusterd_svc_build_shd_volfile_path(volinfo, path, path_len);
17b94a
+
17b94a
+        ret = glusterd_svc_set_shd_pidfile(volinfo, dict);
17b94a
+        if (ret == -1) {
17b94a
+            gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_DICT_SET_FAILED,
17b94a
+                   "Couldn't set pidfile in dict for volid=%s", volid_ptr);
17b94a
+            goto out;
17b94a
+        }
17b94a
         ret = 0;
17b94a
         goto out;
17b94a
     }
17b94a
@@ -919,6 +927,7 @@ __server_getspec(rpcsvc_request_t *req)
17b94a
     char addrstr[RPCSVC_PEER_STRLEN] = {0};
17b94a
     peer_info_t *peerinfo = NULL;
17b94a
     xlator_t *this = NULL;
17b94a
+    dict_t *dict = NULL;
17b94a
 
17b94a
     this = THIS;
17b94a
     GF_ASSERT(this);
17b94a
@@ -971,6 +980,12 @@ __server_getspec(rpcsvc_request_t *req)
17b94a
         goto fail;
17b94a
     }
17b94a
 
17b94a
+    dict = dict_new();
17b94a
+    if (!dict) {
17b94a
+        ret = -ENOMEM;
17b94a
+        goto fail;
17b94a
+    }
17b94a
+
17b94a
     trans = req->trans;
17b94a
     /* addrstr will be empty for cli socket connections */
17b94a
     ret = rpcsvc_transport_peername(trans, (char *)&addrstr, sizeof(addrstr));
17b94a
@@ -989,12 +1004,26 @@ __server_getspec(rpcsvc_request_t *req)
17b94a
      */
17b94a
     if (strlen(addrstr) == 0 || gf_is_local_addr(addrstr)) {
17b94a
         ret = build_volfile_path(volume, filename, sizeof(filename),
17b94a
-                                 TRUSTED_PREFIX);
17b94a
+                                 TRUSTED_PREFIX, dict);
17b94a
     } else {
17b94a
-        ret = build_volfile_path(volume, filename, sizeof(filename), NULL);
17b94a
+        ret = build_volfile_path(volume, filename, sizeof(filename), NULL,
17b94a
+                                 dict);
17b94a
     }
17b94a
 
17b94a
     if (ret == 0) {
17b94a
+        if (dict->count > 0) {
17b94a
+            ret = dict_allocate_and_serialize(dict, &rsp.xdata.xdata_val,
17b94a
+                                              &rsp.xdata.xdata_len);
17b94a
+            if (ret) {
17b94a
+                gf_msg(this->name, GF_LOG_ERROR, 0,
17b94a
+                       GD_MSG_DICT_SERL_LENGTH_GET_FAIL,
17b94a
+                       "Failed to serialize dict "
17b94a
+                       "to request buffer");
17b94a
+                goto fail;
17b94a
+            }
17b94a
+            dict->extra_free = rsp.xdata.xdata_val;
17b94a
+        }
17b94a
+
17b94a
         /* to allocate the proper buffer to hold the file data */
17b94a
         ret = sys_stat(filename, &stbuf);
17b94a
         if (ret < 0) {
17b94a
@@ -1036,7 +1065,6 @@ __server_getspec(rpcsvc_request_t *req)
17b94a
             goto fail;
17b94a
         }
17b94a
     }
17b94a
-
17b94a
     /* convert to XDR */
17b94a
 fail:
17b94a
     if (spec_fd >= 0)
17b94a
@@ -1056,6 +1084,10 @@ fail:
17b94a
                           (xdrproc_t)xdr_gf_getspec_rsp);
17b94a
     free(args.key);  // malloced by xdr
17b94a
     free(rsp.spec);
17b94a
+
17b94a
+    if (dict)
17b94a
+        dict_unref(dict);
17b94a
+
17b94a
     if (args.xdata.xdata_val)
17b94a
         free(args.xdata.xdata_val);
17b94a
 
17b94a
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
17b94a
index 9ea695e..454877b 100644
17b94a
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
17b94a
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
17b94a
@@ -655,6 +655,8 @@ glusterd_brick_op_build_payload(glusterd_op_t op,
17b94a
             break;
17b94a
     }
17b94a
 
17b94a
+    brick_req->dict.dict_len = 0;
17b94a
+    brick_req->dict.dict_val = NULL;
17b94a
     ret = dict_allocate_and_serialize(dict, &brick_req->input.input_val,
17b94a
                                       &brick_req->input.input_len);
17b94a
     if (ret)
17b94a
@@ -723,6 +725,8 @@ glusterd_node_op_build_payload(glusterd_op_t op, gd1_mgmt_brick_op_req **req,
17b94a
             goto out;
17b94a
     }
17b94a
 
17b94a
+    brick_req->dict.dict_len = 0;
17b94a
+    brick_req->dict.dict_val = NULL;
17b94a
     ret = dict_allocate_and_serialize(dict, &brick_req->input.input_val,
17b94a
                                       &brick_req->input.input_len);
17b94a
 
17b94a
diff --git a/xlators/mgmt/glusterd/src/glusterd-shd-svc-helper.c b/xlators/mgmt/glusterd/src/glusterd-shd-svc-helper.c
17b94a
index 57ceda9..5661e39 100644
17b94a
--- a/xlators/mgmt/glusterd/src/glusterd-shd-svc-helper.c
17b94a
+++ b/xlators/mgmt/glusterd/src/glusterd-shd-svc-helper.c
17b94a
@@ -126,3 +126,28 @@ glusterd_shd_svcproc_cleanup(glusterd_shdsvc_t *shd)
17b94a
 out:
17b94a
     return;
17b94a
 }
17b94a
+
17b94a
+int
17b94a
+glusterd_svc_set_shd_pidfile(glusterd_volinfo_t *volinfo, dict_t *dict)
17b94a
+{
17b94a
+    int ret = -1;
17b94a
+    glusterd_svc_t *svc = NULL;
17b94a
+    xlator_t *this = NULL;
17b94a
+
17b94a
+    this = THIS;
17b94a
+    GF_VALIDATE_OR_GOTO("glusterd", this, out);
17b94a
+    GF_VALIDATE_OR_GOTO(this->name, volinfo, out);
17b94a
+    GF_VALIDATE_OR_GOTO(this->name, dict, out);
17b94a
+
17b94a
+    svc = &(volinfo->shd.svc);
17b94a
+
17b94a
+    ret = dict_set_dynstr_with_alloc(dict, "pidfile", svc->proc.pidfile);
17b94a
+    if (ret) {
17b94a
+        gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_DICT_SET_FAILED,
17b94a
+               "Failed to set pidfile %s in dict", svc->proc.pidfile);
17b94a
+        goto out;
17b94a
+    }
17b94a
+    ret = 0;
17b94a
+out:
17b94a
+    return ret;
17b94a
+}
17b94a
diff --git a/xlators/mgmt/glusterd/src/glusterd-shd-svc-helper.h b/xlators/mgmt/glusterd/src/glusterd-shd-svc-helper.h
17b94a
index 59466ec..1f0984b 100644
17b94a
--- a/xlators/mgmt/glusterd/src/glusterd-shd-svc-helper.h
17b94a
+++ b/xlators/mgmt/glusterd/src/glusterd-shd-svc-helper.h
17b94a
@@ -36,4 +36,7 @@ glusterd_recover_shd_attach_failure(glusterd_volinfo_t *volinfo,
17b94a
 int
17b94a
 glusterd_shdsvc_create_volfile(glusterd_volinfo_t *volinfo);
17b94a
 
17b94a
+int
17b94a
+glusterd_svc_set_shd_pidfile(glusterd_volinfo_t *volinfo, dict_t *dict);
17b94a
+
17b94a
 #endif
17b94a
diff --git a/xlators/mgmt/glusterd/src/glusterd-shd-svc.c b/xlators/mgmt/glusterd/src/glusterd-shd-svc.c
17b94a
index 8ad90a9..590169f 100644
17b94a
--- a/xlators/mgmt/glusterd/src/glusterd-shd-svc.c
17b94a
+++ b/xlators/mgmt/glusterd/src/glusterd-shd-svc.c
17b94a
@@ -258,14 +258,20 @@ glusterd_shdsvc_manager(glusterd_svc_t *svc, void *data, int flags)
17b94a
     gf_boolean_t shd_restart = _gf_false;
17b94a
 
17b94a
     conf = THIS->private;
17b94a
-    volinfo = data;
17b94a
     GF_VALIDATE_OR_GOTO("glusterd", conf, out);
17b94a
     GF_VALIDATE_OR_GOTO("glusterd", svc, out);
17b94a
+    volinfo = data;
17b94a
     GF_VALIDATE_OR_GOTO("glusterd", volinfo, out);
17b94a
 
17b94a
     if (volinfo)
17b94a
         glusterd_volinfo_ref(volinfo);
17b94a
 
17b94a
+    if (volinfo->is_snap_volume) {
17b94a
+        /* healing of a snap volume is not supported yet*/
17b94a
+        ret = 0;
17b94a
+        goto out;
17b94a
+    }
17b94a
+
17b94a
     while (conf->restart_shd) {
17b94a
         synclock_unlock(&conf->big_lock);
17b94a
         sleep(2);
17b94a
diff --git a/xlators/mgmt/glusterd/src/glusterd-svc-helper.c b/xlators/mgmt/glusterd/src/glusterd-svc-helper.c
17b94a
index 400826f..e106111 100644
17b94a
--- a/xlators/mgmt/glusterd/src/glusterd-svc-helper.c
17b94a
+++ b/xlators/mgmt/glusterd/src/glusterd-svc-helper.c
17b94a
@@ -519,7 +519,7 @@ glusterd_shd_svc_mux_init(glusterd_volinfo_t *volinfo, glusterd_svc_t *svc)
17b94a
                 /* Take first entry from the process */
17b94a
                 parent_svc = cds_list_entry(mux_proc->svcs.next, glusterd_svc_t,
17b94a
                                             mux_svc);
17b94a
-                sys_link(parent_svc->proc.pidfile, svc->proc.pidfile);
17b94a
+                glusterd_copy_file(parent_svc->proc.pidfile, svc->proc.pidfile);
17b94a
                 mux_conn = &parent_svc->conn;
17b94a
                 if (volinfo)
17b94a
                     volinfo->shd.attached = _gf_true;
17b94a
@@ -623,12 +623,9 @@ glusterd_svc_attach_cbk(struct rpc_req *req, struct iovec *iov, int count,
17b94a
     glusterd_volinfo_t *volinfo = NULL;
17b94a
     glusterd_shdsvc_t *shd = NULL;
17b94a
     glusterd_svc_t *svc = frame->cookie;
17b94a
-    glusterd_svc_t *parent_svc = NULL;
17b94a
-    glusterd_svc_proc_t *mux_proc = NULL;
17b94a
     glusterd_conf_t *conf = NULL;
17b94a
     int *flag = (int *)frame->local;
17b94a
     xlator_t *this = THIS;
17b94a
-    int pid = -1;
17b94a
     int ret = -1;
17b94a
     gf_getspec_rsp rsp = {
17b94a
         0,
17b94a
@@ -679,27 +676,7 @@ glusterd_svc_attach_cbk(struct rpc_req *req, struct iovec *iov, int count,
17b94a
     }
17b94a
 
17b94a
     if (rsp.op_ret == 0) {
17b94a
-        pthread_mutex_lock(&conf->attach_lock);
17b94a
-        {
17b94a
-            if (!strcmp(svc->name, "glustershd")) {
17b94a
-                mux_proc = svc->svc_proc;
17b94a
-                if (mux_proc &&
17b94a
-                    !gf_is_service_running(svc->proc.pidfile, &pid)) {
17b94a
-                    /*
17b94a
-                     * When svc's are restarting, there is a chance that the
17b94a
-                     * attached svc might not have updated it's pid. Because
17b94a
-                     * it was at connection stage. So in that case, we need
17b94a
-                     * to retry the pid file copy.
17b94a
-                     */
17b94a
-                    parent_svc = cds_list_entry(mux_proc->svcs.next,
17b94a
-                                                glusterd_svc_t, mux_svc);
17b94a
-                    if (parent_svc)
17b94a
-                        sys_link(parent_svc->proc.pidfile, svc->proc.pidfile);
17b94a
-                }
17b94a
-            }
17b94a
-            svc->online = _gf_true;
17b94a
-        }
17b94a
-        pthread_mutex_unlock(&conf->attach_lock);
17b94a
+        svc->online = _gf_true;
17b94a
         gf_msg(this->name, GF_LOG_INFO, 0, GD_MSG_SVC_ATTACH_FAIL,
17b94a
                "svc %s of volume %s attached successfully to pid %d", svc->name,
17b94a
                volinfo->volname, glusterd_proc_get_pid(&svc->proc));
17b94a
@@ -726,7 +703,7 @@ out:
17b94a
 
17b94a
 extern size_t
17b94a
 build_volfile_path(char *volume_id, char *path, size_t path_len,
17b94a
-                   char *trusted_str);
17b94a
+                   char *trusted_str, dict_t *dict);
17b94a
 
17b94a
 int
17b94a
 __glusterd_send_svc_configure_req(glusterd_svc_t *svc, int flags,
17b94a
@@ -751,6 +728,7 @@ __glusterd_send_svc_configure_req(glusterd_svc_t *svc, int flags,
17b94a
     ssize_t req_size = 0;
17b94a
     call_frame_t *frame = NULL;
17b94a
     gd1_mgmt_brick_op_req brick_req;
17b94a
+    dict_t *dict = NULL;
17b94a
     void *req = &brick_req;
17b94a
     void *errlbl = &&err;
17b94a
     struct rpc_clnt_connection *conn;
17b94a
@@ -776,6 +754,8 @@ __glusterd_send_svc_configure_req(glusterd_svc_t *svc, int flags,
17b94a
     brick_req.name = volfile_id;
17b94a
     brick_req.input.input_val = NULL;
17b94a
     brick_req.input.input_len = 0;
17b94a
+    brick_req.dict.dict_val = NULL;
17b94a
+    brick_req.dict.dict_len = 0;
17b94a
 
17b94a
     frame = create_frame(this, this->ctx->pool);
17b94a
     if (!frame) {
17b94a
@@ -783,7 +763,13 @@ __glusterd_send_svc_configure_req(glusterd_svc_t *svc, int flags,
17b94a
     }
17b94a
 
17b94a
     if (op == GLUSTERD_SVC_ATTACH) {
17b94a
-        (void)build_volfile_path(volfile_id, path, sizeof(path), NULL);
17b94a
+        dict = dict_new();
17b94a
+        if (!dict) {
17b94a
+            ret = -ENOMEM;
17b94a
+            goto *errlbl;
17b94a
+        }
17b94a
+
17b94a
+        (void)build_volfile_path(volfile_id, path, sizeof(path), NULL, dict);
17b94a
 
17b94a
         ret = sys_stat(path, &stbuf);
17b94a
         if (ret < 0) {
17b94a
@@ -818,6 +804,18 @@ __glusterd_send_svc_configure_req(glusterd_svc_t *svc, int flags,
17b94a
             ret = -EIO;
17b94a
             goto *errlbl;
17b94a
         }
17b94a
+        if (dict->count > 0) {
17b94a
+            ret = dict_allocate_and_serialize(dict, &brick_req.dict.dict_val,
17b94a
+                                              &brick_req.dict.dict_len);
17b94a
+            if (ret) {
17b94a
+                gf_msg(this->name, GF_LOG_ERROR, 0,
17b94a
+                       GD_MSG_DICT_SERL_LENGTH_GET_FAIL,
17b94a
+                       "Failed to serialize dict "
17b94a
+                       "to request buffer");
17b94a
+                goto *errlbl;
17b94a
+            }
17b94a
+            dict->extra_free = brick_req.dict.dict_val;
17b94a
+        }
17b94a
 
17b94a
         frame->cookie = svc;
17b94a
         frame->local = GF_CALLOC(1, sizeof(int), gf_gld_mt_int);
17b94a
@@ -862,6 +860,8 @@ __glusterd_send_svc_configure_req(glusterd_svc_t *svc, int flags,
17b94a
     GF_ATOMIC_INC(conf->blockers);
17b94a
     ret = rpc_clnt_submit(rpc, &gd_brick_prog, op, cbkfn, &iov, 1, NULL, 0,
17b94a
                           iobref, frame, NULL, 0, NULL, 0, NULL);
17b94a
+    if (dict)
17b94a
+        dict_unref(dict);
17b94a
     GF_FREE(volfile_content);
17b94a
     if (spec_fd >= 0)
17b94a
         sys_close(spec_fd);
17b94a
@@ -874,6 +874,9 @@ maybe_free_iobuf:
17b94a
         iobuf_unref(iobuf);
17b94a
     }
17b94a
 err:
17b94a
+    if (dict)
17b94a
+        dict_unref(dict);
17b94a
+
17b94a
     GF_FREE(volfile_content);
17b94a
     if (spec_fd >= 0)
17b94a
         sys_close(spec_fd);
17b94a
diff --git a/xlators/mgmt/glusterd/src/glusterd-syncop.c b/xlators/mgmt/glusterd/src/glusterd-syncop.c
17b94a
index 618d8bc..a8098df 100644
17b94a
--- a/xlators/mgmt/glusterd/src/glusterd-syncop.c
17b94a
+++ b/xlators/mgmt/glusterd/src/glusterd-syncop.c
17b94a
@@ -143,6 +143,8 @@ gd_brick_op_req_free(gd1_mgmt_brick_op_req *req)
17b94a
     if (!req)
17b94a
         return;
17b94a
 
17b94a
+    if (req->dict.dict_val)
17b94a
+        GF_FREE(req->dict.dict_val);
17b94a
     GF_FREE(req->input.input_val);
17b94a
     GF_FREE(req);
17b94a
 }
17b94a
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
17b94a
index 4c487d0..2eb5116 100644
17b94a
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
17b94a
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
17b94a
@@ -5914,6 +5914,8 @@ send_attach_req(xlator_t *this, struct rpc_clnt *rpc, char *path,
17b94a
     brick_req.name = path;
17b94a
     brick_req.input.input_val = NULL;
17b94a
     brick_req.input.input_len = 0;
17b94a
+    brick_req.dict.dict_val = NULL;
17b94a
+    brick_req.dict.dict_len = 0;
17b94a
 
17b94a
     req_size = xdr_sizeof((xdrproc_t)xdr_gd1_mgmt_brick_op_req, req);
17b94a
     iobuf = iobuf_get2(rpc->ctx->iobuf_pool, req_size);
17b94a
@@ -5977,7 +5979,7 @@ err:
17b94a
 
17b94a
 extern size_t
17b94a
 build_volfile_path(char *volume_id, char *path, size_t path_len,
17b94a
-                   char *trusted_str);
17b94a
+                   char *trusted_str, dict_t *dict);
17b94a
 
17b94a
 static int
17b94a
 attach_brick(xlator_t *this, glusterd_brickinfo_t *brickinfo,
17b94a
@@ -6022,7 +6024,7 @@ attach_brick(xlator_t *this, glusterd_brickinfo_t *brickinfo,
17b94a
         goto out;
17b94a
     }
17b94a
 
17b94a
-    (void)build_volfile_path(full_id, path, sizeof(path), NULL);
17b94a
+    (void)build_volfile_path(full_id, path, sizeof(path), NULL, NULL);
17b94a
 
17b94a
     for (tries = 15; tries > 0; --tries) {
17b94a
         rpc = rpc_clnt_ref(other_brick->rpc);
17b94a
-- 
17b94a
1.8.3.1
17b94a