mon: Fix infinite looping, if failed_notes is empty.

Reported-by: Henry C Chang <henry_c_chang@tcloudcomputing.com>
This commit is contained in:
Greg Farnum 2010-09-22 09:49:58 -07:00
parent 2e71037250
commit 2c5a3d99aa

View File

@ -426,7 +426,8 @@ bool OSDMonitor::prepare_failure(MOSDFailure *m)
}
} else { //remove the report
multimap<int, pair<int, int> >::iterator i = failed_notes.lower_bound(target_osd);
while ((i->first == target_osd) && (i->second.first != reporter))
while ((i->first == target_osd) && (i->second.first != reporter)
&& i != failed_notes.end())
++i;
if (i->second.first != reporter)
dout(0) << "got an OSD not-failed report from osd" << reporter