diff options
author | Sage Weil <sage@inktank.com> | 2013-06-16 20:13:51 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-06-16 20:13:51 -0700 |
commit | f179dc1f3d7eb912639dfc1d10290fe00137f69f (patch) | |
tree | 9307a368c2fdd3fc99bef25524c6c30a3c1e770e | |
parent | 2fe4d29f4de567483b28b880ad90fa9f189f9c13 (diff) | |
download | ceph-f179dc1f3d7eb912639dfc1d10290fe00137f69f.tar.gz |
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 <sage@inktank.com>
-rw-r--r-- | src/mon/OSDMonitor.cc | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 7625a500448..cf0e45d9a65 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; |