// failure --
-bool OSDMonitor::preprocess_failure(MOSDFailure *m)
-{
- // who is target_osd
- int badboy = m->get_target().name.num();
-
+bool OSDMonitor::check_source(PaxosServiceMessage *m, uuid_d fsid) {
// check permissions
MonSession *session = m->get_session();
if (!session)
- goto didit;
+ return true;
if (!session->caps.check_privileges(PAXOS_OSDMAP, MON_CAP_X)) {
- dout(0) << "got MOSDFailure from entity with insufficient caps "
+ dout(0) << "got osdmap change request from entity with insufficient caps "
<< session->caps << dendl;
- goto didit;
+ return true;
+ }
+ if (fsid != mon->monmap->fsid) {
+ dout(0) << "check_source: on fsid " << fsid
+ << " != " << mon->monmap->fsid << dendl;
+ return true;
}
+ return false;
+}
- if (m->fsid != mon->monmap->fsid) {
- dout(0) << "preprocess_failure on fsid " << m->fsid << " != " << mon->monmap->fsid << dendl;
+
+bool OSDMonitor::preprocess_failure(MOSDFailure *m)
+{
+ // who is target_osd
+ int badboy = m->get_target().name.num();
+
+ // check permissions
+ if (check_source(m, m->fsid))
goto didit;
- }
// first, verify the reporting host is valid
if (m->get_orig_source().is_osd()) {
void remove_redundant_pg_temp();
void remove_down_pg_temp();
int reweight_by_utilization(int oload, std::string& out_str);
+
+ bool check_source(PaxosServiceMessage *m, uuid_d fsid);
bool preprocess_failure(class MOSDFailure *m);
bool prepare_failure(class MOSDFailure *m);