queue_update_task() took the lock by rvalue reference, so its early
returns never released it. In handle_update_task() that left m_lock
held across the on_finish->complete() calls; during shutdown a
completion can re-enter try_remove_mirror_image_status() and re-lock
m_lock, deadlocking.
Take the unique_lock by value so it unlocks on every return path.
Fixes: https://tracker.ceph.com/issues/78047
Signed-off-by: Sun Yuechi <sunyuechi@iscas.ac.cn>
template <typename I>
void MirrorStatusUpdater<I>::queue_update_task(
- std::unique_lock<ceph::mutex>&& locker) {
+ std::unique_lock<ceph::mutex> locker) {
if (!m_initialized) {
return;
}
void schedule_timer_task();
void handle_timer_task(int r);
- void queue_update_task(std::unique_lock<ceph::mutex>&& locker);
+ void queue_update_task(std::unique_lock<ceph::mutex> locker);
void update_task(int r);
void handle_update_task(int r);