From: Sage Weil Date: Sat, 22 Nov 2014 01:37:03 +0000 (-0800) Subject: crush/CrushWrapper: fix _search_item_exists X-Git-Tag: v0.91~47^2~22^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=eeadd60714d908a3a033aeb7fd542c511e63122b;p=ceph.git crush/CrushWrapper: fix _search_item_exists Reported-by: Pawel Sadowski Signed-off-by: Sage Weil --- diff --git a/src/crush/CrushWrapper.cc b/src/crush/CrushWrapper.cc index 20a722a0941d..dd05b11c0efc 100644 --- a/src/crush/CrushWrapper.cc +++ b/src/crush/CrushWrapper.cc @@ -235,8 +235,8 @@ bool CrushWrapper::_search_item_exists(int item) const if (!crush->buckets[i]) continue; crush_bucket *b = crush->buckets[i]; - for (unsigned i=0; isize; ++i) { - if (b->items[i] == item) + for (unsigned j=0; jsize; ++j) { + if (b->items[j] == item) return true; } }