From: Patrick Donnelly Date: Thu, 7 Jul 2016 23:09:56 +0000 (-0400) Subject: mon: use clearer code structure X-Git-Tag: v10.2.6~117^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=05916271c17050fd4c1ad2351b6da17d3b89fc15;p=ceph.git mon: use clearer code structure The failed map is not changed in the first if, so the second if should be an else. Signed-off-by: Patrick Donnelly (cherry picked from commit adba77e34c3fbf983d221729dd340afcc942778b) --- diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index fc9c1d09b08..d5260ebe8f4 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -2786,11 +2786,9 @@ bool MDSMonitor::maybe_promote_standby(std::shared_ptr fs) do_propose = true; } } - } - - // There were no failures to replace, so try using any available standbys - // as standby-replay daemons. - if (failed.empty()) { + } else { + // There were no failures to replace, so try using any available standbys + // as standby-replay daemons. for (const auto &j : pending_fsmap.standby_daemons) { const auto &gid = j.first; const auto &info = j.second;