From: John Spray Date: Fri, 7 Nov 2014 11:34:43 +0000 (+0000) Subject: tools: fix MDS journal import X-Git-Tag: v0.87.1~71^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7166ff83f6343d31d52a58363e2767434554505c;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/tools/cephfs/Dumper.cc b/src/tools/cephfs/Dumper.cc index fb9a43f76de86..8ee3cdc0b4358 100644 --- a/src/tools/cephfs/Dumper.cc +++ b/src/tools/cephfs/Dumper.cc @@ -159,7 +159,7 @@ void Dumper::undump(const char *dump_file) cout << "start " << start << " len " << len << std::endl; 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 = write_pos; h.stream_format = format;