Blob Blame History Raw
From fdda3f97ae45df1dbad87f11cd2b96b050c5fe2b Mon Sep 17 00:00:00 2001
From: Soumya Koduri <skoduri@redhat.com>
Date: Thu, 30 Jul 2015 17:03:50 +0530
Subject: [PATCH 279/279] logging: Stop using global xlator for log_buf allocations

This reverts commit 765849ee00f6661c9059122ff2346b03b224745f.

With http://review.gluster.org/#/c/10417/, struct mem_accnt
is no longer embedded in a xlator_t object, but instead is
allocated separately. Hence this workaround provided to avoid
crashes in logging infrastructure is no longer needed

This is a backport of the below fix -
    http://review.gluster.org/11811

BUG: 1241761
Change-Id: Ibecf693b912c9d37029f9e1f9da684bf8b292c5e
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Reviewed-on: http://review.gluster.org/11811
Reviewed-by: N Balachandran <nbalacha@redhat.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/55415
Reviewed-by: Nithya Balachandran <nbalacha@redhat.com>
Reviewed-by: Kaleb Keithley <kkeithle@redhat.com>
Tested-by: Kaleb Keithley <kkeithle@redhat.com>
---
 libglusterfs/src/logging.c |   13 -------------
 1 files changed, 0 insertions(+), 13 deletions(-)

diff --git a/libglusterfs/src/logging.c b/libglusterfs/src/logging.c
index c81c5b1..8bbaa3e 100644
--- a/libglusterfs/src/logging.c
+++ b/libglusterfs/src/logging.c
@@ -297,18 +297,6 @@ log_buf_init (log_buf_t *buf, const char *domain, const char *file,
               int errnum, uint64_t msgid, char **appmsgstr, int graph_id)
 {
         int ret = -1;
-        xlator_t        *old_THIS;
-        extern xlator_t global_xlator;
-
-        /*
-         * The current translator will be put in the block header for any
-         * memory block we allocate here.  Unfortunately, these objects might
-         * outlive the current translator, and if we then try to dereference
-         * that pointer we go BOOM.  Since this is really a global structure,
-         * use the global translator.
-         */
-        old_THIS = THIS;
-        THIS = &global_xlator;
 
         if (!buf || !domain || !file || !function || !appmsgstr || !*appmsgstr)
                 goto out;
@@ -339,7 +327,6 @@ log_buf_init (log_buf_t *buf, const char *domain, const char *file,
 
         ret = 0;
 out:
-        THIS = old_THIS;
         return ret;
 }
 
-- 
1.7.1