When an OSD with an id < max_id is removed, i.e. the osd ids are not
continuous, crushtool decompile prints bogus info. Skip any device ids
without a name.
Signed-off-by: Jan Fajerski <jfajerski@suse.com>
out << "\n# devices\n";
for (int i=0; i<crush.get_max_devices(); i++) {
- out << "device " << i << " ";
- print_item_name(out, i, crush);
- print_item_class(out, i, crush);
- out << "\n";
+ const char *name = crush.get_item_name(i);
+ if (name) {
+ out << "device " << i << " " << name;
+ print_item_class(out, i, crush);
+ out << "\n";
+ }
}
out << "\n# types\n";
tunable allowed_bucket_algs 54
# devices
- device 0 device0
device 1 osd.1
device 2 osd.2
device 3 osd.3