From ad60da940d8f1e78716dfa15423113016ecdfc52 Mon Sep 17 00:00:00 2001 From: songweibin Date: Fri, 2 Mar 2018 15:46:11 +0800 Subject: [PATCH] crush: should break the loop if leaves overfull Signed-off-by: songweibin --- src/crush/CrushWrapper.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/crush/CrushWrapper.cc b/src/crush/CrushWrapper.cc index b4643158d35af..837f8062c48f9 100644 --- a/src/crush/CrushWrapper.cc +++ b/src/crush/CrushWrapper.cc @@ -3076,7 +3076,7 @@ int CrushWrapper::_choose_type_stack( ldout(cct, 10) << __func__ << " cumulative_fanout " << cumulative_fanout << dendl; - // identify underful targets for each intermediate level. + // identify underfull targets for each intermediate level. // this serves two purposes: // 1. we can tell when we are selecting a bucket that does not have any underfull // devices beneath it. that means that if the current input includes an overfull @@ -3176,6 +3176,7 @@ int CrushWrapper::_choose_type_stack( for (auto osd : leaves[pos]) { if (overfull.count(osd)) { any_overfull = true; + break; } } if (any_overfull) { -- 2.39.5