mirror of
https://github.com/ceph/ceph
synced 2025-03-11 02:39:05 +00:00
crush: adjust max_devices appropriately in insert_item()
If we insert a new item, make sure max_devices is still the max id + 1. Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
parent
320d1ebf9e
commit
376f0d509b
@ -172,6 +172,12 @@ int CrushWrapper::insert_item(CephContext *cct, int item, float weight, string n
|
||||
|
||||
// now that we've added the (0-weighted) item and any parent buckets, adjust the weight.
|
||||
adjust_item_weightf(cct, item, weight);
|
||||
|
||||
if (item >= crush->max_devices) {
|
||||
crush->max_devices = item + 1;
|
||||
ldout(cct, 5) << "insert_item max_devices now " << crush->max_devices << dendl;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user