]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: assertion to ensure no concurrent processing of replay events 8973/head
authorJason Dillaman <dillaman@redhat.com>
Fri, 6 May 2016 15:16:37 +0000 (11:16 -0400)
committerJason Dillaman <dillaman@redhat.com>
Sat, 7 May 2016 12:23:19 +0000 (08:23 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/Journal.cc
src/librbd/Journal.h

index 265a869d36f8a6e941dc93b8e3aad1ebc9003930..c74f918b3e41a574ddb943d869149bf86c07f586 100644 (file)
@@ -1201,6 +1201,10 @@ void Journal<I>::handle_replay_ready() {
     if (!m_journaler->try_pop_front(&replay_entry)) {
       return;
     }
+
+    // only one entry should be in-flight at a time
+    assert(!m_processing_entry);
+    m_processing_entry = true;
   }
 
   bufferlist data = replay_entry.get_data();
@@ -1246,6 +1250,11 @@ void Journal<I>::handle_replay_process_ready(int r) {
   ldout(cct, 20) << this << " " << __func__ << dendl;
 
   assert(r == 0);
+  {
+    Mutex::Locker locker(m_lock);
+    assert(m_processing_entry);
+    m_processing_entry = false;
+  }
   handle_replay_ready();
 }
 
index 424ef0e4b3201450fe534ebd5fc5dce0ccd05d30..e9bad29efadc0a58c3e196248425758eb3a4a8e6 100644 (file)
@@ -273,6 +273,7 @@ private:
   atomic_t m_op_tid;
   TidToFutures m_op_futures;
 
+  bool m_processing_entry = false;
   bool m_blocking_writes;
 
   journal::Replay<ImageCtxT> *m_journal_replay;