From: Sage Weil Date: Mon, 17 Jun 2013 03:13:51 +0000 (-0700) Subject: mon: make mark_me_down asserts match check X-Git-Tag: v0.65~52 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=f179dc1f3d7eb912639dfc1d10290fe00137f69f;p=ceph.git mon: make mark_me_down asserts match check The OSD may have sent a request where the message source does not match the target in the message. Verify that the target matches so that it matches the assert. Signed-off-by: Sage Weil --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 7625a500448aa..cf0e45d9a65af 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -766,32 +766,33 @@ public: bool OSDMonitor::preprocess_mark_me_down(MOSDMarkMeDown *m) { int requesting_down = m->get_target().name.num(); + int from = m->get_orig_source().num(); // check permissions if (check_source(m, m->fsid)) - goto didit; + goto reply; // first, verify the reporting host is valid - if (m->get_orig_source().is_osd()) { - int from = m->get_orig_source().num(); - if (!osdmap.exists(from) || - osdmap.get_addr(from) != m->get_orig_source_inst().addr || - osdmap.is_down(from)) { - dout(5) << "preprocess_mark_me_down from dead osd." - << from << ", ignoring" << dendl; - send_incremental(m, m->get_epoch()+1); - goto didit; - } + if (!m->get_orig_source().is_osd()) + goto reply; + + if (!osdmap.exists(from) || + osdmap.is_down(from) || + osdmap.get_addr(from) != m->get_target().addr) { + dout(5) << "preprocess_mark_me_down from dead osd." + << from << ", ignoring" << dendl; + send_incremental(m, m->get_epoch()+1); + goto reply; } // no down might be set if (!can_mark_down(requesting_down)) - goto didit; + goto reply; dout(10) << "MOSDMarkMeDown for: " << m->get_target() << dendl; return false; - didit: + reply: Context *c(new C_AckMarkedDown(this, m)); c->complete(0); return true;