]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
rbd-mirror: fix possible recursive lock of ImageReplayer::m_lock
authorN Balachandran <nithya.balachandran@ibm.com>
Sat, 15 Feb 2025 13:26:31 +0000 (18:56 +0530)
committerN Balachandran <nithya.balachandran@ibm.com>
Fri, 28 Feb 2025 03:21:49 +0000 (08:51 +0530)
commitf9c17ce38fd708f7a0c7f58b3e90cba607d4b2e7
treec1909d145137e7d669ae41aeb8790e74f794c5fb
parentd401131b3109c5e303ed004104da3270e7656034
rbd-mirror: fix possible recursive lock of ImageReplayer::m_lock

If periodic status update (LambdaContext which is queued from
handle_update_mirror_image_replay_status()) races with shutdown and
ends up being the last in-flight operation that shutdown was pending
on, we attempt to recursively acquire m_lock in shut_down() because
m_in_flight_op_tracker.finish_op() is called with m_lock (and also
m_threads->timer_lock) held.  These locks are needed only for the call
to schedule_update_mirror_image_replay_status() and should be unlocked
immediately.

Fixes: https://tracker.ceph.com/issues/69978
Co-authored-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: N Balachandran <nithya.balachandran@ibm.com>
(cherry picked from commit c60514087bc29540d3babd7855c5a4e28f2bf1b0)
src/tools/rbd_mirror/ImageReplayer.cc