void Objecter::update_crush_location()
{
RWLock::WLocker rwlocker(rwlock);
- crush_location.clear();
+ std::multimap<string,string> new_crush_location;
vector<string> lvec;
get_str_vec(cct->_conf->crush_location, ";, \t", lvec);
- int r = CrushWrapper::parse_loc_multimap(lvec, &crush_location);
+ int r = CrushWrapper::parse_loc_multimap(lvec, &new_crush_location);
if (r < 0) {
lderr(cct) << "warning: crush_location '" << cct->_conf->crush_location
- << "' does not parse" << dendl;
+ << "' does not parse, leave origin crush_location untouched." << dendl;
+ return;
}
+ crush_location = new_crush_location;
}
// messages ------------------------------