device-class is supported since luminous, so we should fail the init()
if device-class is not updated in crush.
this reverts
244db740: if the device class changes then the user should
either follow the instruction to "ceph osd crush rm-device-class" or fix
CrushWrapper::update_device_class().
this silences clang analyzer warning of:
Value stored to 'r' is never read
Signed-off-by: Kefu Chai <kchai@redhat.com>
string("\"ids\": [\"") + stringify(whoami) + string("\"]}");
r = mon_cmd_maybe_osd_create(cmd);
- // the above cmd can fail for various reasons, e.g.:
- // (1) we are connecting to a pre-luminous monitor
- // (2) user manually specify a class other than
- // 'ceph-disk prepare --crush-device-class'
- // simply skip result-checking for now
- return 0;
+ if (r == -EBUSY) {
+ // good, already bound to a device-class
+ return 0;
+ } else {
+ return r;
+ }
}
void OSD::write_superblock(ObjectStore::Transaction& t)