]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crush: don't recurse to leaf unless item is a bucket
authorSage Weil <sage@newdream.net>
Fri, 12 Dec 2008 21:46:06 +0000 (13:46 -0800)
committerSage Weil <sage@newdream.net>
Sat, 13 Dec 2008 04:22:25 +0000 (20:22 -0800)
This avoids choking on 'chooseleaf indep 0 item device' (it's
equivalent to 'choose indep 0 item device').

src/crush/mapper.c

index d4c90c2dc406435fce891cb71cc6e9556fc64a25..4752c2d73aa51be9f86519b1dd37135d31417287 100644 (file)
@@ -308,6 +308,7 @@ static int crush_choose(struct crush_map *map,
                                }
 
                                if (recurse_to_leaf &&
+                                   item < 0 &&
                                    crush_choose(map, map->buckets[-1-item], weight,
                                                 x, outpos+1, 0,
                                                 out2, outpos,