From fb20713b380e1df8d7f9e9df96563be2f9144fd6 Mon Sep 17 00:00:00 2001 From: Mohit Agrawal Date: Thu, 12 Mar 2020 21:12:13 +0530 Subject: Posix: Use simple approach to close fd Problem: posix_release(dir) functions add the fd's into a ctx->janitor_fds and janitor thread closes the fd's.In brick_mux environment it is difficult to handle race condition in janitor threads because brick spawns a single janitor thread for all bricks. Solution: Use synctask to execute posix_release(dir) functions instead of using background a thread to close fds. Credits: Pranith Karampuri Change-Id: Iffb031f0695a7da83d5a2f6bac8863dad225317e Fixes: bz#1811631 Signed-off-by: Mohit Agrawal --- xlators/storage/posix/src/posix-common.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'xlators/storage/posix/src/posix-common.c') diff --git a/xlators/storage/posix/src/posix-common.c b/xlators/storage/posix/src/posix-common.c index f4003942f4e..20a8d231181 100644 --- a/xlators/storage/posix/src/posix-common.c +++ b/xlators/storage/posix/src/posix-common.c @@ -1029,10 +1029,6 @@ posix_init(xlator_t *this) pthread_mutex_init(&_private->janitor_mutex, NULL); pthread_cond_init(&_private->janitor_cond, NULL); INIT_LIST_HEAD(&_private->fsyncs); - ret = posix_spawn_ctx_janitor_thread(this); - if (ret) - goto out; - ret = gf_thread_create(&_private->fsyncer, NULL, posix_fsyncer, this, "posixfsy"); if (ret) { -- cgit