]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: try_trim_non_auth_subtree if we rename a dir away from a non-auth subtree
authorSage Weil <sage.weil@dreamhost.com>
Wed, 8 Jun 2011 20:29:21 +0000 (13:29 -0700)
committerSage Weil <sage.weil@dreamhost.com>
Wed, 8 Jun 2011 20:29:21 +0000 (13:29 -0700)
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 <sage.weil@dreamhost.com>
src/mds/journal.cc

index 951caa87d53f2e83eedf4e92d6b3fa3787bf2bee..08a9bd9a95f9df94662bcbd84e2990bcf5c15ccf 100644 (file)
@@ -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);