]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: track in-flight flush events for journaling 9672/head
authorJason Dillaman <dillaman@redhat.com>
Tue, 14 Jun 2016 00:20:33 +0000 (20:20 -0400)
committerJason Dillaman <dillaman@redhat.com>
Tue, 14 Jun 2016 00:21:13 +0000 (20:21 -0400)
The tracking for flush events was accidentally dropped. This
can result in the journal being closed too early since it
might miss in-flight flush ops.

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

index db4b2ca74febeea8df8b1a9726d272bf0ff8bcc1..1e892acb794738b949f1efd94965b643dc0ba726 100644 (file)
@@ -135,11 +135,11 @@ namespace librbd {
     }
   }
 
-  void AioCompletion::start_op() {
+  void AioCompletion::start_op(bool ignore_type) {
     Mutex::Locker locker(lock);
     assert(ictx != nullptr);
     assert(!async_op.started());
-    if (state == STATE_PENDING && aio_type != AIO_TYPE_FLUSH) {
+    if (state == STATE_PENDING && (ignore_type || aio_type != AIO_TYPE_FLUSH)) {
       async_op.start_op(*ictx);
     }
   }
index 37d8977be95e2a9a893a3cf0f4d86aa7dbf3359a..758b1d8a6693823632dea63615ff5701d7c679af 100644 (file)
@@ -118,7 +118,7 @@ namespace librbd {
     void finalize(ssize_t rval);
 
     void init_time(ImageCtx *i, aio_type_t t);
-    void start_op();
+    void start_op(bool ignore_type = false);
     void fail(int r);
 
     void complete();
index 3b2868801da18b8bcba6653a33acf405b3351878..1877af146965ac0e884679799217a29f97a3244a 100644 (file)
@@ -472,6 +472,8 @@ void AioImageFlush::send_request() {
   C_AioRequest *req_comp = new C_AioRequest(m_aio_comp);
   m_image_ctx.flush(req_comp);
 
+  // track flush op for block writes
+  m_aio_comp->start_op(true);
   m_aio_comp->put();
 
   m_image_ctx.perfcounter->inc(l_librbd_aio_flush);