]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: use clearer code structure
authorPatrick Donnelly <pdonnell@redhat.com>
Thu, 7 Jul 2016 23:09:56 +0000 (19:09 -0400)
committerNathan Cutler <ncutler@suse.com>
Thu, 26 Jan 2017 09:02:35 +0000 (10:02 +0100)
The failed map is not changed in the first if, so the second if should be an
else.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit adba77e34c3fbf983d221729dd340afcc942778b)

src/mon/MDSMonitor.cc

index fc9c1d09b0853185e0c576523ef84e3cd098e0c4..d5260ebe8f4620dd15decfcaa169b706035319d2 100644 (file)
@@ -2786,11 +2786,9 @@ bool MDSMonitor::maybe_promote_standby(std::shared_ptr<Filesystem> 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;