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