From c94590abb9b2266c0e49167133b4575cfe575488 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 8 Dec 2011 08:41:39 -0800 Subject: [PATCH] crush: set max_devices=0 for map with empty buckets Signed-off-by: Sage Weil --- src/crush/builder.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/crush/builder.c b/src/crush/builder.c index ce1f21bc449f5..fa64b5021edee 100644 --- a/src/crush/builder.c +++ b/src/crush/builder.c @@ -29,6 +29,7 @@ void crush_finalize(struct crush_map *map) __u32 i; /* calc max_devices */ + map->max_devices = 0; for (b=0; bmax_buckets; b++) { if (map->buckets[b] == 0) continue; for (i=0; ibuckets[b]->size; i++) -- 2.39.5