summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/globals.c
diff options
context:
space:
mode:
authorPoornima G <pgurusid@redhat.com>2016-03-19 04:38:47 -0400
committerNiels de Vos <ndevos@redhat.com>2016-03-30 07:22:40 -0700
commit450a853f0059a7ed076253caa982913b08d0485b (patch)
tree05ad49dc01493084dddd3f2449fb0f3285dc9836 /libglusterfs/src/globals.c
parent71d988919c75e1294eb417a92f0a495cf388002e (diff)
gfapi: Fix the crashes caused by global_xlator and THIS
Issue: http://thread.gmane.org/gmane.comp.file-systems.gluster.devel/10922 The right fix for this is elaborate and intrusive, until it is in place, this patch provides a temperory fix. This fix is necessary, as without this libgfapi applications like qemu, samba, NFS ganesha are prone to crashes. This patch will be reverted completely, once the actual fix gets accepted. Credits: Rajesh Joseph, Raghavendra Talur, Anoop CS Back-port of: http://review.gluster.org/#/c/13784/ Change-Id: I8a8a0572bea0eec94ece6aa0d7afcf2f459b4a43 BUG: 1319989 Signed-off-by: Poornima G <pgurusid@redhat.com> Reviewed-on: http://review.gluster.org/13803 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'libglusterfs/src/globals.c')
-rw-r--r--libglusterfs/src/globals.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libglusterfs/src/globals.c b/libglusterfs/src/globals.c
index 8943637ef62..1b25e43351f 100644
--- a/libglusterfs/src/globals.c
+++ b/libglusterfs/src/globals.c
@@ -76,6 +76,11 @@ const char *gf_fop_list[GF_FOP_MAXVALUE] = {
};
/* THIS */
+/* This global ctx is a bad hack to prevent some of the libgfapi crashes.
+ * This should be removed once the patch on resource pool is accepted
+ */
+glusterfs_ctx_t *global_ctx = NULL;
+pthread_mutex_t global_ctx_mutex = PTHREAD_MUTEX_INITIALIZER;
xlator_t global_xlator;
static pthread_key_t this_xlator_key;
static pthread_key_t synctask_key;
@@ -387,7 +392,7 @@ glusterfs_globals_init (glusterfs_ctx_t *ctx)
{
int ret = 0;
- gf_log_globals_init (ctx);
+ gf_log_globals_init (ctx, GF_LOG_INFO);
ret = pthread_once (&globals_inited, gf_globals_init_once);