Skip to content

Commit

Permalink
mon/osdmonitor: cleanup the code for preprocess_mark_me_dead
Browse files Browse the repository at this point in the history
Signed-off-by: Yite Gu <[email protected]>
  • Loading branch information
YiteGu committed Jul 19, 2024
1 parent e7f3bed commit 0a4dda5
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/mon/OSDMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3034,27 +3034,26 @@ bool OSDMonitor::preprocess_mark_me_dead(MonOpRequestRef op)
int from = m->target_osd;

// check permissions
if (check_source(op, m->fsid)) {
mon.no_reply(op);
return true;
}
if (check_source(op, m->fsid))
goto done;

// first, verify the reporting host is valid
if (!m->get_orig_source().is_osd()) {
mon.no_reply(op);
return true;
}
if (!m->get_orig_source().is_osd())
goto done;

if (!osdmap.exists(from) ||
!osdmap.is_down(from)) {
dout(5) << __func__ << " from nonexistent or up osd." << from
<< ", ignoring" << dendl;
send_incremental(op, m->get_epoch()+1);
mon.no_reply(op);
return true;
goto done;
}

return false;

done:
mon.no_reply(op);
return true;
}

bool OSDMonitor::prepare_mark_me_dead(MonOpRequestRef op)
Expand Down

0 comments on commit 0a4dda5

Please sign in to comment.