From d8eadde7d498939c746ea8ddd9dc70a1029b4070 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. Updates: bz#1193929 Change-Id: I8ea2e072411e30790d50084b6b7e909c7bb01d50 Signed-off-by: Xavi Hernandez --- xlators/nfs/server/src/mount3udp_svc.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'xlators/nfs/server/src/mount3udp_svc.c') diff --git a/xlators/nfs/server/src/mount3udp_svc.c b/xlators/nfs/server/src/mount3udp_svc.c index d5e41691f3d..0688779eb65 100644 --- a/xlators/nfs/server/src/mount3udp_svc.c +++ b/xlators/nfs/server/src/mount3udp_svc.c @@ -216,11 +216,7 @@ mount3udp_thread(void *argv) GF_ASSERT(nfsx); - if (glusterfs_this_set(nfsx)) { - gf_msg(GF_MNT, GF_LOG_ERROR, ENOMEM, NFS_MSG_XLATOR_SET_FAIL, - "Failed to set xlator, nfs.mount-udp will not work"); - return NULL; - } + glusterfs_this_set(nfsx); transp = svcudp_create(RPC_ANYSOCK); if (transp == NULL) { -- cgit