]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crush: do not erase non existent name
authorLoic Dachary <ldachary@redhat.com>
Mon, 27 Feb 2017 10:48:18 +0000 (11:48 +0100)
committerLoic Dachary <ldachary@redhat.com>
Wed, 1 Mar 2017 16:24:09 +0000 (17:24 +0100)
Signed-off-by: Loic Dachary <ldachary@redhat.com>
src/crush/CrushWrapper.cc

index 81e08d62b769da98ca47703769d43bb3458e18ca..45c41596016d4dce62533bbd63cfa5f78a8075ba 100644 (file)
@@ -275,8 +275,10 @@ int CrushWrapper::remove_unused_root(int item)
   }
 
   crush_remove_bucket(crush, b);
-  name_map.erase(item);
-  have_rmaps = false;
+  if (name_map.count(item) != 0) {
+    name_map.erase(item);
+    have_rmaps = false;
+  }
   if (class_bucket.count(item) != 0)
     class_bucket.erase(item);
   return 0;