From e0a0f2dc6cd6e46e7864569adf7952b577d5b87c Mon Sep 17 00:00:00 2001 From: John Coyle Date: Tue, 9 Aug 2016 13:57:42 -0400 Subject: [PATCH] bluestore/BitAllocator: Fix deadlock with musl libc pthread_rwlock_wrlock() behaviour is undefined when calling thread holds lock. Added unlock() in shutdown() to avoid deadlock in destructor. http://pubs.opengroup.org/onlinepubs/7908799/xsh/pthread_rwlock_wrlock.html Signed-off-by: John Coyle --- src/os/bluestore/BitAllocator.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/os/bluestore/BitAllocator.cc b/src/os/bluestore/BitAllocator.cc index 0c239efd244d..c03f84be5ec9 100644 --- a/src/os/bluestore/BitAllocator.cc +++ b/src/os/bluestore/BitAllocator.cc @@ -1313,6 +1313,7 @@ BitAllocator::shutdown() { lock_excl(); serial_lock(); + unlock(); } void BitAllocator::unreserve_blocks(int64_t unused) -- 2.47.3