From: Patrick Donnelly Date: Tue, 19 Mar 2019 20:46:39 +0000 (-0700) Subject: Merge PR #26056 into master X-Git-Tag: v15.0.0~201 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ec6cf3a9f1db0a623eef2e371376ac1db468c9c0;p=ceph.git Merge PR #26056 into master * refs/pull/26056/head: mds: check earlier if directories are already exported mds: dont print auth trees if they are too many mds: dont print subtrees if they are too many/big Reviewed-by: Patrick Donnelly --- ec6cf3a9f1db0a623eef2e371376ac1db468c9c0 diff --cc src/mds/MDCache.cc index f98aea0645e1,e6c6f63e5cef..16ce75c324b1 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@@ -11925,8 -11981,15 +11925,15 @@@ void MDCache::show_subtrees(int dbl, bo return; } + if (!force_print && subtrees.size() > SUBTREES_COUNT_THRESHOLD && + !g_conf()->subsys.should_gather()) { + dout(ceph::dout::need_dynamic(dbl)) << "number of subtrees = " << subtrees.size() << "; not " + "printing subtrees" << dendl; + return; + } + // root frags - list basefrags; + std::vector basefrags; for (set::iterator p = base_inodes.begin(); p != base_inodes.end(); ++p) @@@ -11975,11 -12037,16 +11982,17 @@@ } } + if (!force_print && depth > SUBTREES_DEPTH_THRESHOLD && + !g_conf()->subsys.should_gather()) { + dout(ceph::dout::need_dynamic(dbl)) << "max depth among subtrees = " << depth << "; not printing " + "subtrees" << dendl; + return; + } // print tree - for (list::iterator p = basefrags.begin(); p != basefrags.end(); ++p) - q.push_back(pair(*p, 0)); + for (const auto& dir : basefrags) { + q.emplace_back(dir, 0); + } while (!q.empty()) { CDir *dir = q.front().first;