assert(!migrator->is_exporting());
assert(!migrator->is_importing());
- // make mydir subtree go away
- if (mydir) {
- adjust_subtree_auth(mydir, CDIR_AUTH_UNKNOWN);
- remove_subtree(mydir);
- }
- assert(subtrees.empty());
-
- // Still replicas of mydir?
- if ((mydir != NULL) && mydir->inode->is_replicated()) {
- // We do this because otherwise acks to locks could come in after
- // we cap the log.
- dout(7) << "waiting for mydir replicas to release: " << *mydir << dendl;
- return false;
- }
// flush what we can from the log
mds->mdlog->trim(0);
//dump();
return false;
}
+
+ // make mydir subtree go away
+ if (mydir) {
+ if (mydir->get_num_ref() > 1) { // subtree pin
+ dout(7) << "there's still reference to mydir " << *mydir << dendl;
+ show_cache();
+ return false;
+ }
+
+ remove_subtree(mydir);
+ myin->close_dirfrag(mydir->get_frag());
+ }
+ assert(subtrees.empty());
+
+ if (myin)
+ remove_inode(myin);
// done!
dout(2) << "shutdown done." << dendl;