From 85737f94571208f21c972c11530ab56bfaededa2 Mon Sep 17 00:00:00 2001 From: Jan Fajerski Date: Wed, 8 Nov 2017 10:30:09 +0100 Subject: [PATCH] tools/crushtool: skip device id if no name exists When an OSD with an id < max_id is removed, i.e. the osd ids are not continuous, crushtool decompile prints bogus info. Skip any device ids without a name. Signed-off-by: Jan Fajerski --- src/crush/CrushCompiler.cc | 10 ++++++---- src/test/cli/osdmaptool/create-racks.t | 1 - 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/crush/CrushCompiler.cc b/src/crush/CrushCompiler.cc index 8825f7543c0..6ac892a15be 100644 --- a/src/crush/CrushCompiler.cc +++ b/src/crush/CrushCompiler.cc @@ -314,10 +314,12 @@ int CrushCompiler::decompile(ostream &out) out << "\n# devices\n"; for (int i=0; i