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: v0.94.4~77^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=88b583b249a74a71bc87409015f7a8d85200e1bf;p=ceph.git librbd: flush pending ops while not holding lock Signed-off-by: Jason Dillaman (cherry picked from commit 3d5cef38c37e5dda6b23751ad560851f1304d86d) --- diff --git a/src/librbd/ImageWatcher.cc b/src/librbd/ImageWatcher.cc index 600c5da80b33..eb6cd2da6053 100644 --- a/src/librbd/ImageWatcher.cc +++ b/src/librbd/ImageWatcher.cc @@ -380,6 +380,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 646fae542605..f38b4512a70d 100644 --- a/src/librbd/internal.cc +++ b/src/librbd/internal.cc @@ -2474,9 +2474,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 {