]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
filestore: hold journal_lock during
authorSage Weil <sage.weil@dreamhost.com>
Fri, 17 Feb 2012 21:59:08 +0000 (13:59 -0800)
committerSage Weil <sage.weil@dreamhost.com>
Sat, 18 Feb 2012 00:24:10 +0000 (16:24 -0800)
Hold journal_lock during replay so that we don't stomp on variables like
op_seq and open_ops that the the commit thread cares about.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/os/JournalingObjectStore.cc

index cd4a797a1224393743bd12d11d23270a71a93e61..71c96e1c8d601ad8dbdc243d3c67afc947165805 100644 (file)
@@ -55,6 +55,8 @@ int JournalingObjectStore::journal_replay(uint64_t fs_op_seq)
     return err;
   }
 
+  journal_lock.Lock();
+
   replaying = true;
 
   int count = 0;
@@ -81,7 +83,9 @@ int JournalingObjectStore::journal_replay(uint64_t fs_op_seq)
     }
 
     open_ops++;
+    journal_lock.Unlock();
     int r = do_transactions(tls, seq);
+    journal_lock.Lock();
     open_ops--;
     cond.Signal();
 
@@ -99,6 +103,8 @@ int JournalingObjectStore::journal_replay(uint64_t fs_op_seq)
 
   replaying = false;
 
+  journal_lock.Unlock();
+
   // done reading, make writeable.
   journal->make_writeable();