]> 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)
committerDeepika Upadhyay <dupadhya@redhat.com>
Fri, 5 Nov 2021 10:08:59 +0000 (15:38 +0530)
commitdda8e4d2db4e7c65131b3b89f652ab7e9afa9d81
tree1dcccab5e73d75fa1396298e9de28ec3a5f48375
parentbdab9331299d2dd7595221ef4622eaf65e8f4760
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>
(cherry picked from commit c531768838e44ed8eb28e8b27594d7e03ca3ffcf)
src/librbd/cache/pwl/ssd/WriteLog.cc