From: Jason Dillaman Date: Tue, 7 Jun 2016 05:01:09 +0000 (-0400) Subject: librbd: flush journal commit positions before starting op X-Git-Tag: v11.0.0~265^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F9023%2Fhead;p=ceph.git librbd: flush journal commit positions before starting op 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 --- diff --git a/src/librbd/Journal.cc b/src/librbd/Journal.cc index 8e59356afbf9..b24e8611e0bb 100644 --- a/src/librbd/Journal.cc +++ b/src/librbd/Journal.cc @@ -965,6 +965,10 @@ void Journal::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;