Skip to content

Commit 0a4dda5

Browse files
committed
mon/osdmonitor: cleanup the code for preprocess_mark_me_dead
Signed-off-by: Yite Gu <[email protected]>
1 parent e7f3bed commit 0a4dda5

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/mon/OSDMonitor.cc

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3034,27 +3034,26 @@ bool OSDMonitor::preprocess_mark_me_dead(MonOpRequestRef op)
30343034
int from = m->target_osd;
30353035

30363036
// check permissions
3037-
if (check_source(op, m->fsid)) {
3038-
mon.no_reply(op);
3039-
return true;
3040-
}
3037+
if (check_source(op, m->fsid))
3038+
goto done;
30413039

30423040
// first, verify the reporting host is valid
3043-
if (!m->get_orig_source().is_osd()) {
3044-
mon.no_reply(op);
3045-
return true;
3046-
}
3041+
if (!m->get_orig_source().is_osd())
3042+
goto done;
30473043

30483044
if (!osdmap.exists(from) ||
30493045
!osdmap.is_down(from)) {
30503046
dout(5) << __func__ << " from nonexistent or up osd." << from
30513047
<< ", ignoring" << dendl;
30523048
send_incremental(op, m->get_epoch()+1);
3053-
mon.no_reply(op);
3054-
return true;
3049+
goto done;
30553050
}
30563051

30573052
return false;
3053+
3054+
done:
3055+
mon.no_reply(op);
3056+
return true;
30583057
}
30593058

30603059
bool OSDMonitor::prepare_mark_me_dead(MonOpRequestRef op)

0 commit comments

Comments
 (0)