From: Sage Weil Date: Fri, 12 Dec 2008 21:46:06 +0000 (-0800) Subject: crush: don't recurse to leaf unless item is a bucket X-Git-Tag: v0.6~73 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0aecb468169d69db41d603f686909d76476704ce;p=ceph.git crush: don't recurse to leaf unless item is a bucket This avoids choking on 'chooseleaf indep 0 item device' (it's equivalent to 'choose indep 0 item device'). --- diff --git a/src/crush/mapper.c b/src/crush/mapper.c index d4c90c2dc406..4752c2d73aa5 100644 --- a/src/crush/mapper.c +++ b/src/crush/mapper.c @@ -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,