From: Sage Weil Date: Tue, 26 Jul 2011 17:52:49 +0000 (-0700) Subject: mds: only create up renamed diri frag subtrees if they differ from parent X-Git-Tag: v0.33~149 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=699bbe18963317caf16678a2f4f2f3cdbfc30a23;p=ceph.git mds: only create up renamed diri frag subtrees if they differ from parent Commit 00ec86a2041 opens up subtrees with CDIR_AUTH_UNDEF blindly for any renamed dir inode. This is correct on the rename target, but not on a random observer, where we end up with the parent and child having the same auth. Oddly the comment seemed to have it right. Fix the code. Signed-off-by: Sage Weil --- diff --git a/src/mds/journal.cc b/src/mds/journal.cc index 6fe73f46163a..650fdf1f6668 100644 --- a/src/mds/journal.cc +++ b/src/mds/journal.cc @@ -646,17 +646,19 @@ void EMetaBlob::replay(MDS *mds, LogSegment *logseg) } // if we are the srci importer, we'll also have some dirfrags we have to open up... - for (list::iterator p = renamed_dir_frags.begin(); p != renamed_dir_frags.end(); ++p) { - CDir *dir = renamed_diri->get_dirfrag(*p); - if (dir) { - // we already had the inode before, and we already adjusted this subtree accordingly. - dout(10) << " already had+adjusted rename import bound " << *dir << dendl; - assert(olddir); - continue; + if (renamed_diri->authority() != CDIR_AUTH_UNDEF) { + for (list::iterator p = renamed_dir_frags.begin(); p != renamed_dir_frags.end(); ++p) { + CDir *dir = renamed_diri->get_dirfrag(*p); + if (dir) { + // we already had the inode before, and we already adjusted this subtree accordingly. + dout(10) << " already had+adjusted rename import bound " << *dir << dendl; + assert(olddir); + continue; + } + dir = renamed_diri->get_or_open_dirfrag(mds->mdcache, *p); + dout(10) << " creating new rename import bound " << *dir << dendl; + mds->mdcache->adjust_subtree_auth(dir, CDIR_AUTH_UNDEF, false); } - dir = renamed_diri->get_or_open_dirfrag(mds->mdcache, *p); - dout(10) << " creating new rename import bound " << *dir << dendl; - mds->mdcache->adjust_subtree_auth(dir, CDIR_AUTH_UNDEF, false); } }