Actions
Bug #2096
closedcrush: adjust weight broken for tree, list buckets
Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
% Done:
0%
Source:
Community (dev)
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(RADOS):
Pull request ID:
Crash signature (v1):
Crash signature (v2):
Description
From: ZhuRongze <zrz4ceph@gmail.com> Date: Wed, Feb 15, 2012 at 5:51 AM Subject: I found some problem in CRUSH code To: ceph-devel <ceph-devel@vger.kernel.org> Hi, The function crush_adjust_tree_bucket_item_weight in ceph-0.41/src/crush/builder.c seem to ?have a bug. The argument weight is no use, because it is assigned . -------------------------------------------------------------------- int crush_adjust_tree_bucket_item_weight(struct crush_bucket_tree *bucket, int item, int weight) { ? ?int diff; ? ?int node; ? ?unsigned i, j; ? ?unsigned depth = calc_depth(bucket->h.size); ? ?for (i = 0; i < bucket->h.size; i++) { ? ? ? ?if (bucket->h.items[i] == item) ? ? ? ? ? ?break; ? ?} ? ?if (i == bucket->h.size) ? ? ? ?return 0; ? ?node = crush_calc_tree_node(i); ? ?diff = weight = bucket->node_weights[node]; ? ?bucket->node_weights[node] = weight; ? ?bucket->h.weight += diff; ? ?for (j=1; j<depth; j++) { ? ? ? ?node = parent(node); ? ? ? ?bucket->node_weights[node] += diff; ? ?} ? ?return diff;
those = should be -, as with the straw bucket code.
1- make a cli test that breaks on current code
2- fix the bug
Updated by Sage Weil about 12 years ago
- Status changed from 4 to Resolved
commit:708be0a5abef63a5da8409ad13719adb7bb744f8
Updated by Greg Farnum almost 7 years ago
- Project changed from Ceph to RADOS
- Category deleted (
10) - Target version deleted (
v0.43)
Actions