From: Yan, Zheng Date: Tue, 14 Jan 2014 02:08:40 +0000 (+0800) Subject: mds: fix MDCache::adjust_subtree_after_rename() X-Git-Tag: v0.78~165^2~22 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1080fa45712b91df4965af0035f3287ccffaab75;p=ceph.git mds: fix MDCache::adjust_subtree_after_rename() 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 --- diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index c819f211f794..ee6237cd2f0f 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -1298,7 +1298,9 @@ void MDCache::adjust_subtree_after_rename(CInode *diri, CDir *olddir, // adjust subtree list 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::iterator p = dfls.begin(); p != dfls.end(); ++p) { CDir *dir = *p;