From 6697af343dfbe135735a035cbf592b94750bd589 Mon Sep 17 00:00:00 2001 From: Xavi Hernandez Date: Tue, 5 Mar 2019 18:58:20 +0100 Subject: core: avoid dynamic TLS allocation when possible Some interdependencies between logging and memory management functions make it impossible to use the logging framework before initializing memory subsystem because they both depend on Thread Local Storage allocated through pthread_key_create() during initialization. This causes a crash when we try to log something very early in the initialization phase. To prevent this, several dynamically allocated TLS structures have been replaced by static TLS reserved at compile time using '__thread' keyword. This also reduces the number of error sources, making initialization simpler. Backport of: > BUG: 1193929 > Change-Id: I8ea2e072411e30790d50084b6b7e909c7bb01d50 > Signed-off-by: Xavi Hernandez Updates: bz#1724210 Change-Id: I8ea2e072411e30790d50084b6b7e909c7bb01d50 Signed-off-by: Xavi Hernandez --- cli/src/cli.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'cli/src/cli.c') diff --git a/cli/src/cli.c b/cli/src/cli.c index 0c019aabfa3..a2c4496a5d8 100644 --- a/cli/src/cli.c +++ b/cli/src/cli.c @@ -802,8 +802,7 @@ main(int argc, char *argv[]) int ret = -1; glusterfs_ctx_t *ctx = NULL; - mem_pools_init_early(); - mem_pools_init_late(); + mem_pools_init(); ctx = glusterfs_ctx_new(); if (!ctx) -- cgit