]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crush: fix leaf recursion if we already collided
authorSage Weil <sage@inktank.com>
Thu, 7 Jun 2012 23:52:57 +0000 (16:52 -0700)
committerSage Weil <sage@inktank.com>
Fri, 8 Jun 2012 17:58:11 +0000 (10:58 -0700)
This just saves us some cycles, but does not effect placement results at
all.

Signed-off-by: Sage Weil <sage@inktank.com>
src/crush/mapper.c

index f691535af6e62705e2d5224850e6d1a3b9185de7..8ca87d794d0804c660d0a97f797186fefc29f4ab 100644 (file)
@@ -392,7 +392,7 @@ static int crush_choose(const struct crush_map *map,
                                }
 
                                reject = 0;
-                               if (recurse_to_leaf) {
+                               if (!collide && recurse_to_leaf) {
                                        if (item < 0) {
                                                if (crush_choose(map,
                                                         map->buckets[-1-item],