]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crush: fix get_full_location_ordered 2585/head
authorSage Weil <sage@inktank.com>
Sat, 28 Dec 2013 16:55:02 +0000 (08:55 -0800)
committerLoic Dachary <loic-201408@dachary.org>
Sat, 27 Sep 2014 09:28:51 +0000 (11:28 +0200)
This should return -ENOENT when an id is not present.  Broken by
746069ee62c74ecf04ed45988029d5c3382a38d2.

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit d4f07cd90b4037964a18e5c05a3cc5ddd73fb393)

src/crush/CrushWrapper.cc

index 65e7df2860331b0e8af9e05a9afa7d0262213e7b..b03fa1723d71e7400eda4f8cadd5662d5a156b40 100644 (file)
@@ -241,6 +241,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) {