From: John Coyle Date: Tue, 9 Aug 2016 17:57:42 +0000 (-0400) Subject: bluestore/BitAllocator: Fix deadlock with musl libc X-Git-Tag: ses5-milestone5~143^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F10634%2Fhead;p=ceph.git 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 --- 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)