From b1aa517a88524b7b094325ce8ab77cc19c27c20e Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 21 Sep 2018 17:15:16 -0500 Subject: [PATCH] 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 --- src/crush/CrushCompiler.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/crush/CrushCompiler.cc b/src/crush/CrushCompiler.cc index ee5017555ad..a512489bc57 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(); -- 2.39.5