From: Sage Weil Date: Thu, 23 Feb 2012 19:03:44 +0000 (-0800) Subject: crush: fix weight adjust for list, tree buckets X-Git-Tag: v0.43~16^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=286df2db3ea4e7ba6522e2042685f0c971b3fa6d;p=ceph.git crush: fix weight adjust for list, tree buckets Fix the typo. Code now matches that for straw buckets. Reported-by: ZhuRongze Signed-off-by: Sage Weil --- diff --git a/src/crush/builder.c b/src/crush/builder.c index dcf5a8b64578..c68fdf04eed2 100644 --- a/src/crush/builder.c +++ b/src/crush/builder.c @@ -727,7 +727,7 @@ int crush_adjust_list_bucket_item_weight(struct crush_bucket_list *bucket, int i if (i == bucket->h.size) return 0; - diff = weight = bucket->item_weights[i]; + diff = weight - bucket->item_weights[i]; bucket->item_weights[i] = weight; bucket->h.weight += diff; @@ -752,7 +752,7 @@ int crush_adjust_tree_bucket_item_weight(struct crush_bucket_tree *bucket, int i return 0; node = crush_calc_tree_node(i); - diff = weight = bucket->node_weights[node]; + diff = weight - bucket->node_weights[node]; bucket->node_weights[node] = weight; bucket->h.weight += diff;