]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr: fix message refcounting
authorJohn Spray <john.spray@redhat.com>
Thu, 20 Apr 2017 21:15:51 +0000 (17:15 -0400)
committerKefu Chai <kchai@redhat.com>
Sun, 30 Apr 2017 02:30:03 +0000 (10:30 +0800)
Let's be consistent and push the m->put down into
the handle_(M<class>* m) functions the way
we do in the rest of the codebase.

Signed-off-by: John Spray <john.spray@redhat.com>
src/mgr/Mgr.cc
src/mgr/MgrStandby.cc

index 771d21058c1519ac71d8539e5aca0aa9cedafbfb..eb6c9a1639b28991a4761e8e897008dd29fe69d9 100644 (file)
@@ -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<MLog *>(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();
 }
 
index daa482b93255e47a14cc6a453d37fb498e31c8cb..613a075e7ed9194b783e6ca83dafebfb7d7c99ae 100644 (file)
@@ -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;
 }