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