]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crush: fix get_full_location_ordered
authorSage Weil <sage@inktank.com>
Sat, 28 Dec 2013 16:55:02 +0000 (08:55 -0800)
committerSage Weil <sage@inktank.com>
Sat, 28 Dec 2013 16:55:02 +0000 (08:55 -0800)
This should return -ENOENT when an id is not present.  Broken by
746069ee62c74ecf04ed45988029d5c3382a38d2.

Signed-off-by: Sage Weil <sage@inktank.com>
src/crush/CrushWrapper.cc

index 041594bfcab336035513b11ad777ee44e87a897e..ae4ec1c78d205f37a63cbf0d63bd58a8e30c791d 100644 (file)
@@ -323,6 +323,8 @@ map<string, string> CrushWrapper::get_full_location(int id)
 
 int CrushWrapper::get_full_location_ordered(int id, vector<pair<string, string> >& path)
 {
+  if (!item_exists(id))
+    return -ENOENT;
   int cur = id;
   int ret;
   while (true) {