]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix MDCache::adjust_subtree_after_rename()
authorYan, Zheng <zheng.z.yan@intel.com>
Tue, 14 Jan 2014 02:08:40 +0000 (10:08 +0800)
committerYan, Zheng <zheng.z.yan@intel.com>
Mon, 17 Feb 2014 01:37:50 +0000 (09:37 +0800)
process subtree dirfrags first, then process nested dirfrags. because
the code that processes nested dirfrags treats unprocessed subtree
dirfrags as child directories' dirfrags.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
src/mds/MDCache.cc

index c819f211f794458101ce20477c67984dd8bf20f5..ee6237cd2f0f7a7b293b5d064efffb1e81742299 100644 (file)
@@ -1298,7 +1298,9 @@ void MDCache::adjust_subtree_after_rename(CInode *diri, CDir *olddir,
 
   // adjust subtree
   list<CDir*> dfls;
-  diri->get_dirfrags(dfls);
+  // make sure subtree dirfrags are at the front of the list
+  diri->get_subtree_dirfrags(dfls);
+  diri->get_nested_dirfrags(dfls);
   for (list<CDir*>::iterator p = dfls.begin(); p != dfls.end(); ++p) {
     CDir *dir = *p;