From f79ae2504ad5355d20b137019afddb4d3f3cd204 Mon Sep 17 00:00:00 2001 From: John Spray Date: Thu, 20 Apr 2017 17:15:51 -0400 Subject: [PATCH] mgr: fix message refcounting Let's be consistent and push the m->put down into the handle_(M* m) functions the way we do in the rest of the codebase. Signed-off-by: John Spray --- src/mgr/Mgr.cc | 7 +++++-- src/mgr/MgrStandby.cc | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/mgr/Mgr.cc b/src/mgr/Mgr.cc index 771d21058c151..eb6c9a1639b28 100644 --- a/src/mgr/Mgr.cc +++ b/src/mgr/Mgr.cc @@ -449,6 +449,8 @@ void Mgr::handle_log(MLog *m) for (const auto &e : m->entries) { py_modules.notify_all(e); } + + m->put(); } bool Mgr::ms_dispatch(Message *m) @@ -472,11 +474,12 @@ bool Mgr::ms_dispatch(Message *m) ceph_abort(); py_modules.notify_all("mon_map", ""); + m->put(); break; case CEPH_MSG_FS_MAP: py_modules.notify_all("fs_map", ""); handle_fs_map((MFSMap*)m); - m->put(); + return false; // I shall let this pass through for Client break; case CEPH_MSG_OSD_MAP: handle_osd_map(); @@ -490,7 +493,6 @@ bool Mgr::ms_dispatch(Message *m) break; case MSG_LOG: handle_log(static_cast(m)); - m->put(); break; default: @@ -574,6 +576,7 @@ void Mgr::handle_mgr_digest(MMgrDigest* m) // the pgmap might have changed since last time we were here. py_modules.notify_all("pg_summary", ""); dout(10) << "done." << dendl; + m->put(); } diff --git a/src/mgr/MgrStandby.cc b/src/mgr/MgrStandby.cc index daa482b93255e..613a075e7ed91 100644 --- a/src/mgr/MgrStandby.cc +++ b/src/mgr/MgrStandby.cc @@ -242,6 +242,8 @@ void MgrStandby::handle_mgr_map(MMgrMap* mmap) active_mgr.reset(); } } + + mmap->put(); } bool MgrStandby::ms_dispatch(Message *m) @@ -264,7 +266,6 @@ bool MgrStandby::ms_dispatch(Message *m) } } - m->put(); return true; } -- 2.39.5