From: Yan, Zheng Date: Wed, 16 Jan 2013 12:17:23 +0000 (+0800) Subject: mds: fix for MDCache::adjust_bounded_subtree_auth X-Git-Tag: v0.57~88^2~12 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=baa6bd6b1c1e0e09986fca208e3f86f4f8711e69;p=ceph.git mds: fix for MDCache::adjust_bounded_subtree_auth After swallowing extra subtrees, subtree bounds may change, so it should re-check. Signed-off-by: Yan, Zheng --- diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index b50a58b45ab..9a8d7e7deeb 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -999,17 +999,19 @@ void MDCache::adjust_bounded_subtree_auth(CDir *dir, set& bounds, pair::iterator p = subtrees[dir].begin(); - while (p != subtrees[dir].end()) { - set::iterator n = p; - n++; - if (bounds.count(*p) == 0) { - CDir *stray = *p; - dout(10) << " swallowing extra subtree at " << *stray << dendl; - adjust_subtree_auth(stray, auth); - try_subtree_merge_at(stray); - } - p = n; + while (!subtrees[dir].empty()) { + set copy = subtrees[dir]; + for (set::iterator p = copy.begin(); p != copy.end(); p++) { + if (bounds.count(*p) == 0) { + CDir *stray = *p; + dout(10) << " swallowing extra subtree at " << *stray << dendl; + adjust_subtree_auth(stray, auth); + try_subtree_merge_at(stray); + } + } + // swallowing subtree may add new subtree bounds + if (copy == subtrees[dir]) + break; } // bound should now match.