]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crush: no need to double check root bucket id
authorChangcheng Liu <changcheng.liu@aliyun.com>
Mon, 24 Aug 2020 02:53:39 +0000 (10:53 +0800)
committerChangcheng Liu <changcheng.liu@aliyun.com>
Sun, 6 Sep 2020 12:56:59 +0000 (20:56 +0800)
root bucket id should be definitely less than 0. assert(r < 0) here.
There's no possible to find device items in find_nonshadow_roots.

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
src/crush/CrushWrapper.cc

index ed766719508880d0f42f23d532019e9671c35a1a..c3a19308d61cb3cacdd4619fa72e71c3b5010283 100644 (file)
@@ -1799,8 +1799,7 @@ int CrushWrapper::populate_classes(
   set<int> roots;
   find_nonshadow_roots(&roots);
   for (auto &r : roots) {
-    if (r >= 0)
-      continue;
+    assert(r < 0);
     for (auto &c : class_name) {
       int clone;
       int res = device_class_clone(r, c.first, old_class_bucket, used_ids,