From: Sage Weil Date: Sun, 23 Jun 2013 15:52:46 +0000 (-0700) Subject: mon: do not leak no_reply messages X-Git-Tag: v0.65~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9b2dfb7507f930d868ee7f09a0a9da51072d03dc;p=ceph.git mon: do not leak no_reply messages I think I assumed no_reply() was releasing the references, but it is not. Which is better, since send_reply() doesn't either. Fix the leaks by dropping the message ref explicitly. Signed-off-by: Sage Weil Reviewed-by: Joao Eduardo Luis --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 9db57b9d93d6..76915a5f4a1b 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -968,8 +968,10 @@ bool OSDMonitor::prepare_failure(MOSDFailure *m) << m->get_orig_source_inst() << "\n"; failure_info_t& fi = failure_info[target_osd]; MOSDFailure *old = fi.add_report(reporter, failed_since, m); - if (old) + if (old) { mon->no_reply(old); + old->put(); + } return check_failure(now, target_osd, fi); } else { @@ -983,6 +985,7 @@ bool OSDMonitor::prepare_failure(MOSDFailure *m) fi.cancel_report(reporter); while (!ls.empty()) { mon->no_reply(ls.front()); + ls.front()->put(); ls.pop_front(); } if (fi.reporters.empty()) { @@ -997,6 +1000,7 @@ bool OSDMonitor::prepare_failure(MOSDFailure *m) dout(10) << " no failure_info for osd." << target_osd << dendl; } mon->no_reply(m); + m->put(); } return false;