]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crushtool: verify explicit item pos
authorSage Weil <sage@newdream.net>
Mon, 6 Oct 2008 21:38:03 +0000 (14:38 -0700)
committerSage Weil <sage@newdream.net>
Mon, 6 Oct 2008 21:38:03 +0000 (14:38 -0700)
src/crushtool.cc

index 91bd029569fa4be0897cb38d78404a95e6d4d89f..49c76ebfefed852ca86cd73dfe94990a40e9cff5 100644 (file)
@@ -170,6 +170,10 @@ void parse_bucket(iter_t const& i, CrushWrapper &crush)
        string tag = string_node(sub->children[q++]);
        if (tag == "pos") {
          int pos = int_node(sub->children[q]);
+         if (used_items.count(pos)) {
+           cerr << "item '" << string_node(sub->children[1]) << "' in bucket '" << name << "' has explicit pos " << pos << ", which is occupied" << std::endl;
+           exit(1);
+         }
          used_items.insert(pos);
        }
       }