]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/FileJournal: When dump journal, using correctly seq avoid misjudging joural corrupt. 2764/head
authorMa Jianpeng <jianpeng.ma@intel.com>
Mon, 21 Jul 2014 07:08:55 +0000 (15:08 +0800)
committerSage Weil <sage@redhat.com>
Tue, 21 Oct 2014 13:56:17 +0000 (06:56 -0700)
In func FileJournal::dump, it always using seq=0 as last-seq and it can
misjudge the journal corrupt.

Signed-off-by: Ma Jianpeng <jianpeng.ma@intel.com>
(cherry picked from commit 5f65b4db6d1dad7c2c5a09eab42af63a82ea9e9b)

src/os/FileJournal.cc

index ce98877d96f0aaa6f5f0601d4edaf95e0ea91342..5eab7b530aa2fca1b955891f1bc6f08eec0a3aac 100644 (file)
@@ -567,9 +567,9 @@ int FileJournal::dump(ostream& out)
   JSONFormatter f(true);
 
   f.open_array_section("journal");
+  uint64_t seq = 0;
   while (1) {
     bufferlist bl;
-    uint64_t seq = 0;
     uint64_t pos = read_pos;
     if (!read_entry(bl, seq)) {
       dout(3) << "journal_replay: end of journal, done." << dendl;