From 0a4dda59ca3c2cc276f23d8d25b3b443f506d39c Mon Sep 17 00:00:00 2001 From: Yite Gu Date: Fri, 19 Jul 2024 16:51:34 +0800 Subject: [PATCH] mon/osdmonitor: cleanup the code for preprocess_mark_me_dead Signed-off-by: Yite Gu --- src/mon/OSDMonitor.cc | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index b70fcc064dd80..52f438207c3a7 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -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)