From: Sage Weil Date: Sat, 28 Dec 2013 16:55:02 +0000 (-0800) Subject: crush: fix get_full_location_ordered X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F2583%2Fhead;p=ceph.git 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) --- 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) {