]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: fix memory-leaked messages
authorGreg Farnum <gregf@hq.newdream.net>
Tue, 8 Jun 2010 19:10:47 +0000 (12:10 -0700)
committerGreg Farnum <gregf@hq.newdream.net>
Tue, 8 Jun 2010 22:13:37 +0000 (15:13 -0700)
src/mon/AuthMonitor.cc
src/mon/ClassMonitor.cc
src/mon/MDSMonitor.cc
src/mon/Paxos.cc

index 31e3fa54d1d522ddd9dd4df8cb6174a0df8e12f7..f67424a4d632abb7c53b86bb833d861b45ef08dc 100644 (file)
@@ -409,6 +409,7 @@ bool AuthMonitor::prep_auth(MAuth *m, bool paxos_writable)
       delete s->auth_handler;
       s->auth_handler = NULL;
 
+      //we don't m->put() here because assign_global_id has queued it up
       if (mon->is_leader())
        return false;
       return true;
@@ -648,5 +649,6 @@ bool AuthMonitor::prepare_global_id(MMonGlobalID *m)
   dout(10) << "AuthMonitor::prepare_global_id" << dendl;
   increase_max_global_id();
 
+  m->put();
   return true;
 }
index 936768f0c5a84e0e6fc8aab28d1f713fd15d817b..eab18814140e94f410c3ab8db339fab66d1d853c 100644 (file)
@@ -230,6 +230,7 @@ bool ClassMonitor::preprocess_class(MClass *m)
   }
   if (!num_new) {
     dout(10) << "  nothing new" << dendl;
+    m->put();
     return true;
   }
   return false;
@@ -440,8 +441,10 @@ void ClassMonitor::handle_request(MClass *m)
   dout(10) << "handle_request " << *m << " from " << m->get_orig_source() << dendl;
   MClass *reply = new MClass();
 
-  if (!reply)
+  if (!reply) {
+    m->put();
     return;
+  }
 
   deque<ClassImpl>::iterator impl_iter = m->impl.begin();
   deque<bool>::iterator add_iter = m->add.begin();
index cc8e16bbc2ae4e8c2acee9845d9a1bc37d7fec8f..0e7bd2a71054f99c5d3ecf226730fba338a2c597 100644 (file)
@@ -368,6 +368,7 @@ bool MDSMonitor::prepare_offload_targets(MMDSLoadTargets *m)
   } else {
     dout(10) << "prepare_offload_targets " << gid << " not in map" << dendl;
   }
+  m->put();
   return true;
 }
 
index ddc85ed0b87d423684249d659918a73010db0645..ddeb348d442fd5e7789b63a5e05b4a23c94842ec 100644 (file)
@@ -455,6 +455,7 @@ void Paxos::handle_accept(MMonPaxos *accept)
     finish_contexts(waiting_for_readable);
     finish_contexts(waiting_for_writeable);
   }
+  accept->put();
 }
 
 void Paxos::accept_timeout()