dout(10) << "handle_pg_stats_ack " << dendl;
if (!require_mon_peer(ack)) {
+ ack->put();
return;
}
void OSD::handle_command(MMonCommand *m)
{
- if (!require_mon_peer(m))
+ if (!require_mon_peer(m)) {
+ m->put();
return;
+ }
Command *c = new Command(m->cmd, m->get_tid(), m->get_data(), NULL);
command_wq.queue(c);
void OSD::handle_scrub(MOSDScrub *m)
{
dout(10) << "handle_scrub " << *m << dendl;
- if (!require_mon_peer(m))
+ if (!require_mon_peer(m)) {
+ m->put();
return;
+ }
if (m->fsid != monc->get_fsid()) {
dout(0) << "handle_scrub fsid " << m->fsid << " != " << monc->get_fsid() << dendl;
m->put();
take_waiters(waiting_for_osdmap);
}
-bool OSD::require_mon_peer(Message *m)
+bool OSD::require_mon_peer(const Message *m)
{
if (!m->get_connection()->peer_is_mon()) {
dout(0) << "require_mon_peer received from non-mon "
<< m->get_connection()->get_peer_addr()
<< " " << *m << dendl;
- m->put();
return false;
}
return true;
dout(10) << "handle_pg_create " << *m << dendl;
- /* we have to hack around require_mon_peer's interface limits, so
- * grab an extra reference before going in. If the peer isn't
- * a Monitor, the reference is put for us (and then cleared
- * up automatically by our OpTracker infrastructure). Otherwise,
- * we put the extra ref ourself.
- */
- if (!require_mon_peer(op->get_req()->get())) {
+ if (!require_mon_peer(op->get_req())) {
return;
}
- op->get_req()->put();
if (!require_same_or_newer_map(op, m->epoch, false))
return;
vector<pair<pg_notify_t, pg_interval_map_t> > >& info_map,
OSDMapRef map);
- bool require_mon_peer(Message *m);
+ bool require_mon_peer(const Message *m);
bool require_osd_peer(Message *m);
/***
* Verifies that we were alive in the given epoch, and that