From: Changcheng Liu Date: Mon, 24 Aug 2020 02:53:39 +0000 (+0800) Subject: crush: no need to double check root bucket id X-Git-Tag: v16.1.0~1173^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=51ae2909efc7f78ac5aaea6266afc2ca8084c95f;p=ceph.git crush: no need to double check root bucket id 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 --- diff --git a/src/crush/CrushWrapper.cc b/src/crush/CrushWrapper.cc index ed7667195088..c3a19308d61c 100644 --- a/src/crush/CrushWrapper.cc +++ b/src/crush/CrushWrapper.cc @@ -1799,8 +1799,7 @@ int CrushWrapper::populate_classes( set 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,