From: John Spray Date: Fri, 7 Nov 2014 11:34:43 +0000 (+0000) Subject: tools: fix MDS journal import X-Git-Tag: v0.80.8~29^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F2880%2Fhead;p=ceph.git tools: fix MDS journal import Previously it only worked on fresh filesystems which hadn't been trimmed yet, and resulted in an invalid trimmed_pos when expire_pos wasn't on an object boundary. Fixes: #10025 Signed-off-by: John Spray (cherry picked from commit fb29e71f9a97c12354045ad2e128156e503be696) --- diff --git a/src/mds/Dumper.cc b/src/mds/Dumper.cc index 4e5f28e47198..a1b393ec693e 100644 --- a/src/mds/Dumper.cc +++ b/src/mds/Dumper.cc @@ -160,7 +160,7 @@ void Dumper::undump(const char *dump_file) inodeno_t ino = MDS_INO_LOG_OFFSET + rank; Journaler::Header h; - h.trimmed_pos = start; + h.trimmed_pos = start - (start % g_default_file_layout.fl_object_size); h.expire_pos = start; h.write_pos = start+len; h.magic = CEPH_FS_ONDISK_MAGIC;