it != subtrees.end();
it++) {
CDir *dir = it->first;
- if (dir->get_inode()->is_stray()) continue;
- if (dir->is_frozen() || dir->is_freezing()) continue;
- if (!dir->is_full_dir_auth()) continue;
+ if (dir->get_inode()->is_mdsdir())
+ continue;
+ if (dir->is_frozen() || dir->is_freezing())
+ continue;
+ if (!dir->is_full_dir_auth())
+ continue;
ls.push_back(dir);
}
int max = 5; // throttle shutdown exports.. hack!
for (list<CDir*>::iterator p = ls.begin(); p != ls.end(); ++p) {
CDir *dir = *p;
int dest = dir->get_inode()->authority().first;
- if (dest > 0 && !mds->mdsmap->is_active(dest)) dest = 0;
+ if (dest > 0 && !mds->mdsmap->is_active(dest))
+ dest = 0;
dout(7) << "sending " << *dir << " back to mds" << dest << dendl;
migrator->export_dir(dir, dest);
- if (--max == 0) break;
+ if (--max == 0)
+ break;
}
}
return false;
}
+ // make mydir subtree go away
+ if (myin) {
+ CDir *mydir = myin->get_dirfrag(frag_t());
+ if (mydir && mydir->is_subtree_root()) {
+ adjust_subtree_auth(mydir, CDIR_AUTH_UNKNOWN);
+ remove_subtree(mydir);
+ }
+ }
+
// subtrees map not empty yet?
if (!subtrees.empty()) {
dout(7) << "still have " << num_subtrees() << " subtrees" << dendl;
if (mds->get_nodeid() == 0) return true;
if (!stray) return true;
+ dout(10) << "shutdown_export_strays" << dendl;
+
bool done = true;
static set<inodeno_t> exported_strays;
list<CDir*> dfs;
if (exported_strays.count(dnl->get_inode()->ino()) == 0) {
exported_strays.insert(dnl->get_inode()->ino());
migrate_stray(dn, mds->get_nodeid(), 0); // send to root!
+ } else {
+ dout(10) << "already exporting " << *dn << dendl;
}
}
}
dout(7) << "cluster degraded, no exports for now" << dendl;
return;
}
- if (dir->inode->is_system() &&
- !(MDS_INO_IS_MDSDIR(dir->ino()) && (int)dir->ino() - MDS_INO_MDSDIR_OFFSET == dest) &&
- !(dir->ino() == MDS_INO_MDSDIR(mds->whoami) && mds->is_stopping())) {
+ if (dir->inode->is_base()) {
dout(7) << "i won't export root|stray" << dendl;
//assert(0);
return;