From: "Yan, Zheng" <zheng.z.yan@xxxxxxxxx> this avoids creating bare dirfrags during journal replay. Signed-off-by: Yan, Zheng <zheng.z.yan@xxxxxxxxx> --- src/mds/Server.cc | 10 ++++++++++ src/mds/journal.cc | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/mds/Server.cc b/src/mds/Server.cc index b526b5e..63401e8 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -6306,6 +6306,16 @@ void Server::_rename_prepare(MDRequest *mdr, dout(10) << " forced journaling destdn " << *destdn << dendl; metablob->add_dir_context(destdn->get_dir()); metablob->add_primary_dentry(destdn, true, srci); + if (srcdn->is_auth() && srci->is_dir()) { + // journal new subtrees root dirfrags + list<CDir*> ls; + srci->get_dirfrags(ls); + for (list<CDir*>::iterator p = ls.begin(); p != ls.end(); ++p) { + CDir *dir = *p; + if (dir->is_auth()) + metablob->add_dir(dir, true); + } + } } } diff --git a/src/mds/journal.cc b/src/mds/journal.cc index b8139e3..11ce5ac 100644 --- a/src/mds/journal.cc +++ b/src/mds/journal.cc @@ -1280,7 +1280,8 @@ void EMetaBlob::replay(MDS *mds, LogSegment *logseg, MDSlaveUpdate *slaveup) list<frag_t> leaves; renamed_diri->dirfragtree.get_leaves(leaves); for (list<frag_t>::iterator p = leaves.begin(); p != leaves.end(); ++p) { - CDir *dir = renamed_diri->get_or_open_dirfrag(mds->mdcache, *p); + CDir *dir = renamed_diri->get_dirfrag(*p); + assert(dir); // preserve subtree bound until slave commit if (dir->get_dir_auth() == CDIR_AUTH_UNDEF) slaveup->olddirs.insert(dir); -- 1.8.1.4 -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html