]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
rbd-mirror: fix possible recursive lock of ImageReplayer::m_lock 62043/head
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:23:49 +0000 (08:53 +0530)
commit50c7d04812794427335f9ecd94044b3558396652
tree37cd305d6c801c18cbed33d20b7aa1c08108d71f
parentad999dfb5e2c3b01657a7ffd672cf2ce393572be
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