From: Jason Dillaman Date: Tue, 12 May 2015 14:19:48 +0000 (-0400) Subject: librbd: flush pending ops while not holding lock X-Git-Tag: v9.0.2~46^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F4528%2Fhead;p=ceph.git librbd: flush pending ops while not holding lock Signed-off-by: Jason Dillaman --- diff --git a/src/librbd/ImageWatcher.cc b/src/librbd/ImageWatcher.cc index 05b592f1710..a8a7c2114d8 100644 --- a/src/librbd/ImageWatcher.cc +++ b/src/librbd/ImageWatcher.cc @@ -379,6 +379,7 @@ bool ImageWatcher::release_lock() m_image_ctx.owner_lock.put_write(); m_image_ctx.cancel_async_requests(); + m_image_ctx.flush_async_operations(); m_image_ctx.owner_lock.get_write(); if (!is_lock_owner()) { diff --git a/src/librbd/internal.cc b/src/librbd/internal.cc index 91620e5a68f..92e2b5bfe19 100644 --- a/src/librbd/internal.cc +++ b/src/librbd/internal.cc @@ -2827,9 +2827,10 @@ reprotect_and_return_err: } ictx->aio_work_queue->drain(); - ictx->cancel_async_requests(); + ictx->flush_async_operations(); ictx->readahead.wait_for_pending(); + if (ictx->object_cacher) { ictx->shutdown_cache(); // implicitly flushes } else {