]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
os/newstore: fix deadlock when newstore_sync_transaction=true
authorXiaoxi Chen <xiaoxi.chen@intel.com>
Wed, 29 Apr 2015 05:59:16 +0000 (13:59 +0800)
committerSage Weil <sage@redhat.com>
Tue, 1 Sep 2015 17:39:42 +0000 (13:39 -0400)
commite3abf245ba4a555b695a437fa488ca41b36c2c77
treec0025e511558a65e74ef12aa67a4b279ae09cee8
parentcdc652ebbefb927ac338afbfee16f13044bffa18
os/newstore: fix deadlock when newstore_sync_transaction=true

There is a deadlock issue in Newstore when newstore_sync_transaction = true.
With sync_transaction to true, the txc state machine will go all the way down
from STATE_IO_DONE to STATE_FINISHING in the same thread, while holding the osr->qlock().
The deadlock is caused in _txc_finish and _osr_reap_done, when trying to
lock osr->qlock again.

Since the _txc_finish can be called with(in sync transaction mode) or without
(in async transaction mode) holding the qlock, so fix this by setting the qlock
to PTHREAD_MUTEX_RECURSIVE, thus we can recursive acquire the qlock.

Signed-off-by: Xiaoxi Chen <xiaoxi.chen@intel.com>
src/os/newstore/NewStore.h