]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
bluestore/BitAllocator: Fix deadlock with musl libc
authorJohn Coyle <dx9err@gmail.com>
Tue, 9 Aug 2016 17:57:42 +0000 (13:57 -0400)
committerJohn Coyle <dx9err@gmail.com>
Tue, 9 Aug 2016 17:57:42 +0000 (13:57 -0400)
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 <dx9err@gmail.com>
src/os/bluestore/BitAllocator.cc

index 0c239efd244d2eb7b6a9641a8f9c8f2ee66f6d85..c03f84be5ec9ce4b8d53748c4c3dec6ecd4bbc03 100644 (file)
@@ -1313,6 +1313,7 @@ BitAllocator::shutdown()
 {
   lock_excl();
   serial_lock();
+  unlock();
 }
 
 void BitAllocator::unreserve_blocks(int64_t unused)