From 5628240e7eac9dda0b6c7c92443428b12828fdb1 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 7 Oct 2009 11:54:20 -0700 Subject: [PATCH] crush: zero weight items get 0 length straws --- src/crush/builder.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/crush/builder.c b/src/crush/builder.c index 7ac398db44f..a10f7a455ef 100644 --- a/src/crush/builder.c +++ b/src/crush/builder.c @@ -333,6 +333,13 @@ crush_make_straw_bucket(int type, i=0; while (i < size) { + /* zero weight items get 0 length straws! */ + if (weights[reverse[i]] == 0) { + bucket->straws[reverse[i]] = 0; + i++; + continue; + } + /* set this item's straw */ bucket->straws[reverse[i]] = straw * 0x10000; /*printf("item %d at %d weight %d straw %d (%lf)\n",