]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: flush pending AIO requests under all existing flush scenarios 2697/head
authorJason Dillaman <dillaman@redhat.com>
Tue, 13 Jan 2015 04:17:50 +0000 (23:17 -0500)
committerJason Dillaman <dillaman@redhat.com>
Tue, 13 Jan 2015 04:17:50 +0000 (23:17 -0500)
AIO requests that are waiting on the image lock should be flushed
during all existing RBD flush scenarios.  A few flush cases were
missed in the original implementation.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/internal.cc

index e645fd883189272ad5667fb4f4723b164460f971..77af864c67317a4b9667cbad28cce86c31b68cc4 100644 (file)
@@ -3058,9 +3058,6 @@ reprotect_and_return_err:
       return r;
     }
 
-    if (ictx->image_watcher != NULL) {
-      ictx->image_watcher->flush_aio_operations();
-    }
     ictx->user_flushed();
     r = _flush(ictx);
     ictx->perfcounter->inc(l_librbd_flush);
@@ -3069,6 +3066,10 @@ reprotect_and_return_err:
 
   int _flush(ImageCtx *ictx)
   {
+    if (ictx->image_watcher != NULL) {
+      ictx->image_watcher->flush_aio_operations();
+    }
+
     CephContext *cct = ictx->cct;
     int r;
     // flush any outstanding writes