From 1d3c0c6e3b351f584785c5f603d7b3c52423f79c 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 (cherry picked from commit d4f07cd90b4037964a18e5c05a3cc5ddd73fb393) --- src/crush/CrushWrapper.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/crush/CrushWrapper.cc b/src/crush/CrushWrapper.cc index 65e7df286033..b03fa1723d71 100644 --- a/src/crush/CrushWrapper.cc +++ b/src/crush/CrushWrapper.cc @@ -241,6 +241,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.47.3