Skip to content

Commit

Permalink
librbd: don't flush image_watcher if it's nullptr
Browse files Browse the repository at this point in the history
Signed-off-by: Dongsheng Yang <dongsheng.yang@easystack.cn>
  • Loading branch information
yangdongsheng committed Sep 9, 2016
1 parent 5962a0d commit 9a37724
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/librbd/ExclusiveLock.cc
Expand Up @@ -711,8 +711,11 @@ void ExclusiveLock<I>::handle_shutdown(int r) {

m_image_ctx.aio_work_queue->clear_require_lock_on_read();
m_image_ctx.aio_work_queue->unblock_writes();
m_image_ctx.image_watcher->flush(util::create_context_callback<
ExclusiveLock<I>, &ExclusiveLock<I>::complete_shutdown>(this));
if (m_image_ctx.image_watcher == nullptr)
complete_shutdown(r);
else
m_image_ctx.image_watcher->flush(util::create_context_callback<
ExclusiveLock<I>, &ExclusiveLock<I>::complete_shutdown>(this));
}

template <typename I>
Expand Down

0 comments on commit 9a37724

Please sign in to comment.