We were correctly adjusting all the children, but the subtree root was
not being updated.
Fixes: #11855
Signed-off-by: Sage Weil <sage@redhat.com>
while (!q.empty()) {
b = q.front();
q.pop_front();
+ int local_changed = 0;
for (unsigned i=0; i<b->size; ++i) {
int n = b->items[i];
if (n >= 0) {
crush_bucket_adjust_item_weight(crush, b, n, weight);
+ ++local_changed;
} else {
crush_bucket *sub = get_bucket(n);
if (IS_ERR(sub))
q.push_back(sub);
}
}
+ if (local_changed) {
+ adjust_item_weight(cct, b->id, b->weight);
+ }
}
return changed;
}