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