summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSusant Palai <spalai@redhat.com>2019-04-22 21:18:30 +0530
committerXavi Hernandez <xhernandez@redhat.com>2019-06-28 12:49:37 +0200
commit46edd697b2564d2cf1269fe9059ed2198a47a946 (patch)
tree56e2d1c3ed2928158611caa43c369d2df9c46763
parentc639b94d2b2b55f15435fe49257184b4a2aaaed1 (diff)
core: fix hang issue in __gf_free
Currently GF_ASSERT is done under mem_accounting lock at some places. On a GF_ASSERT failure, gf_msg_callingfn is called which calls gf_malloc internally and it takes the same mem_accounting lock leading to deadlock. This is a temporary fix to avoid any hang issue in master. https://review.gluster.org/#/c/glusterfs/+/22589/ is being worked on in the mean while so that GF_ASSERT can be used under mem_accounting lock. Backport of: > Change-Id: I6d67f23979e7edd2695bdc6aab2997dae4a4060a > BUG: 1700865 > Signed-off-by: Susant Palai <spalai@redhat.com> Change-Id: I6d67f23979e7edd2695bdc6aab2997dae4a4060a Updates: bz#1724210 Signed-off-by: Susant Palai <spalai@redhat.com>
-rw-r--r--libglusterfs/src/mem-pool.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/libglusterfs/src/mem-pool.c b/libglusterfs/src/mem-pool.c
index d717e9ffab9..9b4ea520b84 100644
--- a/libglusterfs/src/mem-pool.c
+++ b/libglusterfs/src/mem-pool.c
@@ -327,7 +327,6 @@ __gf_free(void *free_ptr)
LOCK(&mem_acct->rec[header->type].lock);
{
- GF_ASSERT(mem_acct->rec[header->type].size >= header->size);
mem_acct->rec[header->type].size -= header->size;
mem_acct->rec[header->type].num_allocs--;
/* If all the instances are freed up then ensure typestr is set