diff options
-rw-r--r-- | libglusterfs/src/common-utils.c | 7 | ||||
-rw-r--r-- | xlators/protocol/client/src/client-protocol.c | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c index 6dcc70900d0..17ac7984096 100644 --- a/libglusterfs/src/common-utils.c +++ b/libglusterfs/src/common-utils.c @@ -240,6 +240,13 @@ set_global_ctx_ptr (glusterfs_ctx_t *ctx) gf_global_ctx = ctx; } +/* + * Don't use this function other than in glusterfsd.c. libglusterfsclient does + * not set gf_global_ctx since there can be multiple glusterfs-contexts + * initialized in a single process. Instead access the context from ctx member + * of the xlator object. + */ + glusterfs_ctx_t * get_global_ctx_ptr (void) { diff --git a/xlators/protocol/client/src/client-protocol.c b/xlators/protocol/client/src/client-protocol.c index 0ec96a500af..6572dbf6f6d 100644 --- a/xlators/protocol/client/src/client-protocol.c +++ b/xlators/protocol/client/src/client-protocol.c @@ -5646,7 +5646,7 @@ client_setvolume_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen, if (!remote_subvol) goto out; - ctx = get_global_ctx_ptr (); + ctx = this->ctx; if (process_uuid && !strcmp (ctx->process_uuid,process_uuid)) { ret = dict_get_uint64 (reply, "transport-ptr", |