From c971d58f8a5550b19374b74bb89d69143423479b Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Tue, 20 Sep 2016 10:19:45 -0400 Subject: [PATCH] librbd: potential deadlock closing image with in-flight readahead Fixes: http://tracker.ceph.com/issues/17198 Signed-off-by: Jason Dillaman --- src/librbd/image/CloseRequest.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/librbd/image/CloseRequest.cc b/src/librbd/image/CloseRequest.cc index 4ee52a5872492..fe87f9a6f016e 100644 --- a/src/librbd/image/CloseRequest.cc +++ b/src/librbd/image/CloseRequest.cc @@ -186,8 +186,9 @@ void CloseRequest::send_flush_readahead() { CephContext *cct = m_image_ctx->cct; ldout(cct, 10) << this << " " << __func__ << dendl; - m_image_ctx->readahead.wait_for_pending(create_context_callback< - CloseRequest, &CloseRequest::handle_flush_readahead>(this)); + m_image_ctx->readahead.wait_for_pending(create_async_context_callback( + *m_image_ctx, create_context_callback< + CloseRequest, &CloseRequest::handle_flush_readahead>(this))); } template