]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: flush pending ops while not holding lock
authorJason Dillaman <dillaman@redhat.com>
Tue, 12 May 2015 14:19:48 +0000 (10:19 -0400)
committerJason Dillaman <dillaman@redhat.com>
Tue, 28 Jul 2015 20:36:35 +0000 (16:36 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 3d5cef38c37e5dda6b23751ad560851f1304d86d)

src/librbd/ImageWatcher.cc
src/librbd/internal.cc

index 600c5da80b33a69ef9d28cdaddc609d2267e3c10..eb6cd2da605321a2e6f8357445dd09f21945e06b 100644 (file)
@@ -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()) {
index 646fae542605b7efb0f71aa6a5adf9075ce63b11..f38b4512a70d444e2532bd525fa47b4e3b95efdc 100644 (file)
@@ -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 {