]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crush/CrushCompiler: fix id scan to include class ids
authorSage Weil <sage@redhat.com>
Fri, 21 Sep 2018 22:15:16 +0000 (17:15 -0500)
committerSage Weil <sage@redhat.com>
Tue, 16 Oct 2018 13:50:23 +0000 (08:50 -0500)
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 <sage@redhat.com>
src/crush/CrushCompiler.cc

index ee5017555ad477a5b9c8d2d56c601424d4ba87e2..a512489bc575328a289bb5adfa95eb2910245305 100644 (file)
@@ -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();