@@ -2343,11 +2343,17 @@ ESubtreeMap *MDCache::create_subtree_map()
if (oldparent->get_dir_auth() != newparent->get_dir_auth()) {
dout(10) << " creating subtree for " << dir->dirfrag() << dendl;
// if oldparent is auth, subtree is mine; include it.
- if (oldparent->get_dir_auth().first == mds->whoami)
+ if (oldparent->get_dir_auth().first == mds->whoami) {
le->subtrees[dir->dirfrag()].clear();
+ le->metablob.add_dir_context(dir, EMetaBlob::TO_ROOT);
+ le->metablob.add_dir(dir, false);
+ }
// if newparent is auth, subtree is a new bound
- if (le->subtrees.count(newparent->dirfrag()))
+ if (le->subtrees.count(newparent->dirfrag())) {
le->subtrees[newparent->dirfrag()].push_back(dir->dirfrag()); // newparent is auth; new bound
+ le->metablob.add_dir_context(dir, EMetaBlob::TO_ROOT);
+ le->metablob.add_dir(dir, false);
+ }
newparent = dir;
}