e3c68b
From da53d9027d9426c0023176a42e0550d6ccccc941 Mon Sep 17 00:00:00 2001
e3c68b
From: Susant Palai <spalai@redhat.com>
e3c68b
Date: Mon, 22 Apr 2019 21:18:30 +0530
e3c68b
Subject: [PATCH 114/124] core: fix hang issue in __gf_free
e3c68b
e3c68b
Currently GF_ASSERT is done under mem_accounting lock at some places.
e3c68b
On a GF_ASSERT failure, gf_msg_callingfn is called which calls gf_malloc
e3c68b
internally and it takes the same mem_accounting lock leading to deadlock.
e3c68b
e3c68b
This is a temporary fix to avoid any hang issue in master.
e3c68b
https://review.gluster.org/#/c/glusterfs/+/22589/ is being worked on
e3c68b
in the mean while so that GF_ASSERT can be used under mem_accounting
e3c68b
lock.
e3c68b
e3c68b
> upstream patch : https://review.gluster.org/#/c/glusterfs/+/22600/
e3c68b
e3c68b
>Change-Id: I6d67f23979e7edd2695bdc6aab2997dae4a4060a
e3c68b
>updates: bz#1700865
e3c68b
>Signed-off-by: Susant Palai <spalai@redhat.com>
e3c68b
e3c68b
Change-Id: I6d67f23979e7edd2695bdc6aab2997dae4a4060a
e3c68b
BUG: 1698728
e3c68b
Signed-off-by: Susant Palai <spalai@redhat.com>
e3c68b
Reviewed-on: https://code.engineering.redhat.com/gerrit/168474
e3c68b
Tested-by: RHGS Build Bot <nigelb@redhat.com>
e3c68b
Reviewed-by: Nithya Balachandran <nbalacha@redhat.com>
e3c68b
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
e3c68b
---
e3c68b
 libglusterfs/src/mem-pool.c | 1 -
e3c68b
 1 file changed, 1 deletion(-)
e3c68b
e3c68b
diff --git a/libglusterfs/src/mem-pool.c b/libglusterfs/src/mem-pool.c
e3c68b
index 81badc0..34cb87a 100644
e3c68b
--- a/libglusterfs/src/mem-pool.c
e3c68b
+++ b/libglusterfs/src/mem-pool.c
e3c68b
@@ -348,7 +348,6 @@ __gf_free(void *free_ptr)
e3c68b
 
e3c68b
     LOCK(&mem_acct->rec[header->type].lock);
e3c68b
     {
e3c68b
-        GF_ASSERT(mem_acct->rec[header->type].size >= header->size);
e3c68b
         mem_acct->rec[header->type].size -= header->size;
e3c68b
         mem_acct->rec[header->type].num_allocs--;
e3c68b
         /* If all the instances are freed up then ensure typestr is set
e3c68b
-- 
e3c68b
1.8.3.1
e3c68b