summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
Diffstat (limited to 'api')
-rw-r--r--api/src/glfs-mgmt.c2
-rw-r--r--api/src/glfs.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/api/src/glfs-mgmt.c b/api/src/glfs-mgmt.c
index 1cba1ed1109..86a186e581b 100644
--- a/api/src/glfs-mgmt.c
+++ b/api/src/glfs-mgmt.c
@@ -820,7 +820,7 @@ glfs_mgmt_init (struct glfs *fs)
if (ret)
goto out;
- rpc = rpc_clnt_new (options, THIS->ctx, THIS->name, 8);
+ rpc = rpc_clnt_new (options, ctx, THIS->name, 8);
if (!rpc) {
ret = -1;
gf_log (THIS->name, GF_LOG_WARNING,
diff --git a/api/src/glfs.c b/api/src/glfs.c
index 75dd315f6bd..7542d8b9fcd 100644
--- a/api/src/glfs.c
+++ b/api/src/glfs.c
@@ -563,7 +563,8 @@ pub_glfs_new (const char *volname)
if (ret)
return NULL;
- THIS->ctx = ctx;
+ if (!THIS->ctx)
+ THIS->ctx = ctx;
/* then ctx_defaults_init, for xlator_mem_acct_init(THIS) */
ret = glusterfs_ctx_defaults_init (ctx);