From: Jason Dillaman Date: Tue, 9 Feb 2016 17:10:10 +0000 (-0500) Subject: librbd: do not fire flush completions before associated write X-Git-Tag: v10.1.0~395^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=851395a803138d2c58fe9b2ce0011e8f73a3bd1c;p=ceph.git librbd: do not fire flush completions before associated write Prevents a race condition in journal replay when committing events to the journal. Signed-off-by: Jason Dillaman --- diff --git a/src/librbd/AioCompletion.cc b/src/librbd/AioCompletion.cc index ab71c3c268ea..765c4cfe5f21 100644 --- a/src/librbd/AioCompletion.cc +++ b/src/librbd/AioCompletion.cc @@ -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); }