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