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