Skip to content

Commit

Permalink
Merge pull request ceph#58672 from YiteGu/code-cleanup-osdmon
Browse files Browse the repository at this point in the history
mon/osdmonitor: cleanup the code for preprocess_mark_me_dead

Reviewed-by: Matan Breizman <[email protected]>
  • Loading branch information
yuriw authored Aug 1, 2024
2 parents dd87d57 + 0a4dda5 commit a2b779f
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 a2b779f

Please sign in to comment.