]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
filejournal: fix journal write_pos advance
authorSage Weil <sage@newdream.net>
Mon, 28 Jun 2010 18:34:29 +0000 (11:34 -0700)
committerSage Weil <sage@newdream.net>
Mon, 28 Jun 2010 18:34:29 +0000 (11:34 -0700)
This was broken by bd4188a02abff9efffb87a0a2031efe51c1b4d9a.  @pos needs to
be advanced (it is pass by reference) or else we just overwrite the same
bytes at the journal start over and over again.

src/os/FileJournal.cc

index 74c1b07105ce5826e86702998bf6676bc05d34ac..4f5cbcc93c4dda3fcdc7454cd1ed1d02f92c7943 100644 (file)
@@ -425,6 +425,7 @@ int FileJournal::prepare_multi_write(bufferlist& bl, uint64_t& orig_ops, uint64_
     }
   }
 
+  dout(20) << "prepare_multi_write queue_pos now " << queue_pos << dendl;
   //assert(write_pos + bl.length() == queue_pos);
   return 0;
 }
@@ -511,6 +512,7 @@ void FileJournal::write_bl(off64_t& pos, bufferlist& bl)
     derr(0) << "write_bl failed with " << err << " " << strerror_r(-err, buf, sizeof(buf)) 
            << dendl;
   }
+  pos += bl.length();
 }
 
 void FileJournal::do_write(bufferlist& bl)