From: Sage Weil Date: Wed, 8 Jun 2011 20:29:21 +0000 (-0700) Subject: mds: try_trim_non_auth_subtree if we rename a dir away from a non-auth subtree X-Git-Tag: v0.30~102^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5b43419c72ff7a968b2d8aa957588557361483d2;p=ceph.git mds: try_trim_non_auth_subtree if we rename a dir away from a non-auth subtree It's possible we have non-auth metadata only because we have a subtree nested beneath. If we rename a directory out of a non-auth subtree, we should try to trim any non-auth content from that subtree that may now be possible due to the child subtrees being linked elsewhere. Fixes: #1146 Signed-off-by: Sage Weil --- diff --git a/src/mds/journal.cc b/src/mds/journal.cc index 951caa87d53f2..08a9bd9a95f9d 100644 --- a/src/mds/journal.cc +++ b/src/mds/journal.cc @@ -659,6 +659,12 @@ void EMetaBlob::replay(MDS *mds, LogSegment *logseg) if (olddir) { assert(renamed_diri); mds->mdcache->adjust_subtree_after_rename(renamed_diri, olddir, false); + + // see if we can discard the subtree we renamed out of + CDir *root = mds->mdcache->get_subtree_root(olddir); + if (root->get_dir_auth() == CDIR_AUTH_UNDEF) + mds->mdcache->try_trim_non_auth_subtree(root); + } else { // we imported a diri we haven't seen before assert(!renamed_diri);