From: Yan, Zheng Date: Tue, 11 Mar 2014 02:24:06 +0000 (+0800) Subject: mds: trim other MDS' mdsdir during recovery X-Git-Tag: v0.79~111^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5150fe63d81c0c512ee4315911df20218074c4f8;p=ceph.git mds: trim other MDS' mdsdir during recovery Signed-off-by: Yan, Zheng --- diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 6b963f2842d7..3415ad19b1d6 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -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;