From ab6c9ff91a56e38ca80b0ff855f3aeafefd99fbb Mon Sep 17 00:00:00 2001 From: Xavi Hernandez Date: Fri, 12 Apr 2019 13:40:59 +0200 Subject: core: handle memory accounting correctly When a translator stops, memory accounting for that translator is not destroyed (because there could remain memory allocated that references it), but mutexes that coordinate updates of memory accounting were destroyed. This caused incorrect memory accounting and even crashes in debug mode. This patch also fixes some other things: * Reduce the number of atomic operations needed to manage memory accounting. * Correctly account memory when realloc() is used. * Merge two critical sections into one. * Cleaned the code a bit. Backport of: > Change-Id: Id5eaee7338729b9bc52c931815ca3ff1e5a7dcc8 > BUG: bz#1659334 > Signed-off-by: Xavi Hernandez Change-Id: Id5eaee7338729b9bc52c931815ca3ff1e5a7dcc8 Fixes: bz#1702271 Signed-off-by: Xavi Hernandez --- libglusterfs/src/libglusterfs.sym | 1 + 1 file changed, 1 insertion(+) (limited to 'libglusterfs/src/libglusterfs.sym') diff --git a/libglusterfs/src/libglusterfs.sym b/libglusterfs/src/libglusterfs.sym index e33d5cf14fc..745fb547949 100644 --- a/libglusterfs/src/libglusterfs.sym +++ b/libglusterfs/src/libglusterfs.sym @@ -1093,6 +1093,7 @@ xlator_foreach xlator_foreach_depth_first xlator_init xlator_mem_acct_init +xlator_mem_acct_unref xlator_notify xlator_option_info_list xlator_option_init_bool -- cgit