Previously update_osd_stat had a race with code modifying heartbeat_from
causing the iterator increment to occasionally segfault.
Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
void OSD::_refresh_my_stat(utime_t now)
{
+ assert(heartbeat_lock.is_locked());
assert(peer_stat_lock.is_locked());
// refresh?
osd_peer_stat_t OSD::get_my_stat_for(utime_t now, int peer)
{
+ Mutex::Locker hlock(heartbeat_lock);
Mutex::Locker lock(peer_stat_lock);
_refresh_my_stat(now);
my_stat_on_peer[peer] = my_stat;