]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: do not fire flush completions before associated write
authorJason Dillaman <dillaman@redhat.com>
Tue, 9 Feb 2016 17:10:10 +0000 (12:10 -0500)
committerJason Dillaman <dillaman@redhat.com>
Tue, 9 Feb 2016 17:44:38 +0000 (12:44 -0500)
Prevents a race condition in journal replay when committing events
to the journal.

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

index ab71c3c268ea18f8f66c15db91dace0f7dc8098d..765c4cfe5f2108543827126f57b3f0313d716093 100644 (file)
@@ -91,12 +91,7 @@ namespace librbd {
       ictx->journal->commit_io_event(journal_tid, rval);
     }
 
-    // note: possible for image to be closed after op marked finished
     done = true;
-    if (async_op.started()) {
-      async_op.finish_op();
-    }
-
     if (complete_cb) {
       lock.Unlock();
       complete_cb(rbd_comp, complete_arg);
@@ -110,6 +105,11 @@ namespace librbd {
       ictx->event_socket.notify();
     }
     cond.Signal();
+
+    // note: possible for image to be closed after op marked finished
+    if (async_op.started()) {
+      async_op.finish_op();
+    }
     tracepoint(librbd, aio_complete_exit);
   }