]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crush: set max_devices=0 for map with empty buckets
authorSage Weil <sage.weil@dreamhost.com>
Thu, 8 Dec 2011 16:41:39 +0000 (08:41 -0800)
committerSage Weil <sage.weil@dreamhost.com>
Thu, 8 Dec 2011 16:41:39 +0000 (08:41 -0800)
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/crush/builder.c

index ce1f21bc449f54bb68d193ced1726a6ec6b3f79a..fa64b5021edeecff0c16f6aa1d903ac28775a25a 100644 (file)
@@ -29,6 +29,7 @@ void crush_finalize(struct crush_map *map)
        __u32 i;
 
        /* calc max_devices */
+       map->max_devices = 0;
        for (b=0; b<map->max_buckets; b++) {
                if (map->buckets[b] == 0) continue;
                for (i=0; i<map->buckets[b]->size; i++)