]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
crush/CrushWrapper: fix create_or_move_item when name exists but item does not 3179/head
authorSage Weil <sage@redhat.com>
Mon, 24 Nov 2014 02:50:51 +0000 (18:50 -0800)
committerLoic Dachary <ldachary@redhat.com>
Mon, 15 Dec 2014 09:26:42 +0000 (10:26 +0100)
commit465eedea9f7411b1e352dc3ccee60a3f1221541d
tree7b2418fba5ecb8dfe7d9c7df0b00a18769076fa6
parentcee51af9c1dbde550177c95caf6c93f612442300
crush/CrushWrapper: fix create_or_move_item when name exists but item does not

We were using item_exists(), which simply checks if we have a name defined
for the item.  Instead, use _search_item_exists(), which looks for an
instance of the item somewhere in the hierarchy.  This matches what
get_item_weightf() is doing, which ensures we get a non-negative weight
that converts properly to floating point.

Backport: giant, firefly
Fixes: #9998
Reported-by: Pawel Sadowski <ceph@sadziu.pl>
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 9902383c690dca9ed5ba667800413daa8332157e)
src/crush/CrushWrapper.cc