]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: trim other MDS' mdsdir during recovery
authorYan, Zheng <zheng.z.yan@intel.com>
Tue, 11 Mar 2014 02:24:06 +0000 (10:24 +0800)
committerYan, Zheng <zheng.z.yan@intel.com>
Wed, 19 Mar 2014 03:35:56 +0000 (11:35 +0800)
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
src/mds/MDCache.cc

index 6b963f2842d767516e155c7425551e55f1345883..3415ad19b1d6dd3548b45a0672998ffb75a20f56 100644 (file)
@@ -6784,8 +6784,20 @@ void MDCache::try_trim_non_auth_subtree(CDir *dir)
     // can we trim this subtree (and possibly our ancestors) too?
     while (true) {
       CInode *diri = dir->get_inode();
-      if (diri->is_base())
+      if (diri->is_base()) {
+       if (diri->authority().first != mds->whoami) {
+         dout(10) << " closing empty non-auth subtree " << *dir << dendl;
+         remove_subtree(dir);
+         dir->mark_clean();
+         diri->close_dirfrag(dir->get_frag());
+
+         dout(10) << " removing " << *diri << dendl;
+         assert(!diri->get_parent_dn());
+         assert(diri->get_num_ref() == 0);
+         remove_inode(diri);
+       }
        break;
+      }
 
       CDir *psub = get_subtree_root(diri->get_parent_dir());
       dout(10) << " parent subtree is " << *psub << dendl;