From d4f07cd90b4037964a18e5c05a3cc5ddd73fb393 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sat, 28 Dec 2013 08:55:02 -0800 Subject: [PATCH] crush: fix get_full_location_ordered This should return -ENOENT when an id is not present. Broken by 746069ee62c74ecf04ed45988029d5c3382a38d2. Signed-off-by: Sage Weil --- src/crush/CrushWrapper.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/crush/CrushWrapper.cc b/src/crush/CrushWrapper.cc index 041594bfcab33..ae4ec1c78d205 100644 --- a/src/crush/CrushWrapper.cc +++ b/src/crush/CrushWrapper.cc @@ -323,6 +323,8 @@ map CrushWrapper::get_full_location(int id) int CrushWrapper::get_full_location_ordered(int id, vector >& path) { + if (!item_exists(id)) + return -ENOENT; int cur = id; int ret; while (true) { -- 2.39.5