From 2a8fe8862a15342cc5716c146487d0b42af0fbf6 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Tue, 26 May 2015 16:58:23 +0800 Subject: [PATCH] mon: check the new crush map against osdmap.max_osd Fixes: #11680 Signed-off-by: Kefu Chai (cherry picked from commit 22e6bd6e01d5df3f3e897562597e22ca1737f8c8) --- src/mon/OSDMonitor.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index c8a2e6b175971..5ca2a9b182258 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -4530,7 +4530,7 @@ bool OSDMonitor::prepare_command_impl(MMonCommand *m, // then we would consistently trigger an election before the command // finishes, having a flapping monitor unable to hold quorum. CrushTester tester(crush, ess); - if (!tester.check_name_maps()) { + if (!tester.check_name_maps(osdmap.get_max_osd())) { err = -EINVAL; ss << ess.str(); goto reply; -- 2.39.5