]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: flush journal commit positions before starting op 9023/head
authorJason Dillaman <dillaman@redhat.com>
Tue, 7 Jun 2016 05:01:09 +0000 (01:01 -0400)
committerJason Dillaman <dillaman@redhat.com>
Tue, 7 Jun 2016 11:30:48 +0000 (07:30 -0400)
Ensure all IO has been properly flushed and committed to the
journal before starting an op that could affect the IO path.

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

index 8e59356afbf956f6a9e5a36e037b171f790d39a9..b24e8611e0bb48f2d3018c359ba2ec75f293682a 100644 (file)
@@ -965,6 +965,10 @@ void Journal<I>::append_op_event(uint64_t op_tid,
   }
 
   on_safe = create_async_context_callback(m_image_ctx, on_safe);
+  on_safe = new FunctionContext([this, on_safe](int r) {
+      // ensure all committed IO before this op is committed
+      m_journaler->flush_commit_position(on_safe);
+    });
   future.flush(on_safe);
 
   CephContext *cct = m_image_ctx.cct;