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