]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: assertion to ensure no concurrent processing of replay events 9040/head
authorJason Dillaman <dillaman@redhat.com>
Fri, 6 May 2016 15:16:37 +0000 (11:16 -0400)
committerJason Dillaman <dillaman@redhat.com>
Tue, 10 May 2016 15:58:16 +0000 (11:58 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 44827a3e8e02529be84c829a76ef01f70e0d20ee)

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;