From: Sage Weil Date: Fri, 21 Sep 2018 22:15:16 +0000 (-0500) Subject: crush/CrushCompiler: fix id scan to include class ids X-Git-Tag: v14.1.0~788^2~12 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b1aa517a88524b7b094325ce8ab77cc19c27c20e;p=ceph.git crush/CrushCompiler: fix id scan to include class ids The bucket stanza may specify the canonical id for the bucket as well as ids for the shadow trees. Make not of all ids so we can avoid colliding and reusing them later. Signed-off-by: Sage Weil --- diff --git a/src/crush/CrushCompiler.cc b/src/crush/CrushCompiler.cc index ee5017555ad4..a512489bc575 100644 --- a/src/crush/CrushCompiler.cc +++ b/src/crush/CrushCompiler.cc @@ -1053,9 +1053,13 @@ void CrushCompiler::find_used_bucket_ids(iter_t const& i) { for (iter_t p = i->children.begin(); p != i->children.end(); p++) { if ((int)p->value.id().to_long() == crush_grammar::_bucket) { - iter_t firstline = p->children.begin() + 3; - string tag = string_node(firstline->children[0]); - if (tag == "id") { + for (iter_t firstline = p->children.begin() + 3; + firstline != p->children.end(); + ++firstline) { + string tag = string_node(firstline->children[0]); + if (tag != "id") { + break; + } int id = int_node(firstline->children[1]); //err << "saw bucket id " << id << std::endl; id_item[id] = string();