From: xie xingguo Date: Tue, 2 Feb 2016 09:30:27 +0000 (+0800) Subject: osdc/objecter: update crush location in a safer way X-Git-Tag: v10.0.4~63^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=2445b5e7ebfd42a3a292a86d15aec28c6e494308;p=ceph.git osdc/objecter: update crush location in a safer way Signed-off-by: xie xingguo --- diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index 8fd5c38a3aeb9..cff49d4887731 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -179,14 +179,16 @@ void Objecter::handle_conf_change(const struct md_config_t *conf, void Objecter::update_crush_location() { RWLock::WLocker rwlocker(rwlock); - crush_location.clear(); + std::multimap new_crush_location; vector 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 ------------------------------