]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
crush/CrushWrapper: fix create_or_move_item when name exists but item does not 3178/head
authorSage Weil <sage@redhat.com>
Mon, 24 Nov 2014 02:50:51 +0000 (18:50 -0800)
committerLoic Dachary <ldachary@redhat.com>
Fri, 9 Jan 2015 12:11:47 +0000 (13:11 +0100)
commit636b98faa6b1c9fd6de1b8653d1d282577b54684
treec93adae05e57dea8b406a5ce442ca842d1ac0995
parentced2472664fab06d03de03d7b23325f9319163b7
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