]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
journal: fix mis-merge
authorSage Weil <sage@newdream.net>
Tue, 2 Feb 2010 19:18:49 +0000 (11:18 -0800)
committerSage Weil <sage@newdream.net>
Tue, 2 Feb 2010 19:18:49 +0000 (11:18 -0800)
src/os/FileJournal.cc

index b75de1930be7315dac87faf605ae20fab2405fe1..73bc28d4e09a5c14940ec5443a90ed7201a4c973 100644 (file)
@@ -331,14 +331,6 @@ bool FileJournal::check_for_full(__u64 seq, off64_t pos, off64_t size)
 
   if (room >= size) {
     dout(10) << "check_for_full at " << pos << " : " << size << " < " << room << dendl;
-
-    // wait?
-    if (wait_on_full) {
-      dout(1) << "check_for_full waiting for a commit" << dendl;
-      commit_cond.Wait(write_lock);
-      goto retry;
-    }  
-
     if (pos + size > header.max_size)
       must_write_header = true;
     return true;
@@ -349,6 +341,14 @@ bool FileJournal::check_for_full(__u64 seq, off64_t pos, off64_t size)
          << pos << " >= " << room
          << " (max_size " << header.max_size << " start " << header.start << ")"
          << dendl;
+
+  // wait?
+  if (wait_on_full) {
+    dout(1) << "check_for_full waiting for a commit" << dendl;
+    commit_cond.Wait(write_lock);
+    goto retry;
+  }  
+
   full_commit_seq = seq;
   full_restart_seq = seq+1;
   while (!writeq.empty()) {