]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
librbd/cache/pwl/ssd: move finish_op() to the end of callback function
authorYin Congmin <congmin.yin@intel.com>
Fri, 27 Aug 2021 15:41:49 +0000 (15:41 +0000)
committerYin Congmin <congmin.yin@intel.com>
Mon, 1 Nov 2021 06:53:49 +0000 (14:53 +0800)
commitc531768838e44ed8eb28e8b27594d7e03ca3ffcf
tree8e338f6002e6cab0b9d792aecc3b0dc27b401ddf
parent066b8a6d2ee091839b9b21ac89b8dfcebf8825cd
librbd/cache/pwl/ssd: move finish_op() to the end of callback function

finish_op() of ssd cache is not in the end of callback function in
append_op_log_entries(), and after finish_op(),  some operation also
need to get m_lock. So, during shutdown, wait_for_ops() thinks all OPs
are over, and no thread will acquire the m_lock, In the subsequent
operation of shutdown, the m_lock is obtained, and _aio_stop() in
bdev->close() waits for all aio_writes() and aio_submit() to end
when the m_lock is held, but the callback function of aio_write() is
waiting for the m_lock, causing a deadlock. Move finish_op() to the
end to fix dead lock.

Fixes: https://tracker.ceph.com/issues/52235
Signed-off-by: Yin Congmin <congmin.yin@intel.com>
src/librbd/cache/pwl/ssd/WriteLog.cc