From: Loic Dachary Date: Mon, 27 Feb 2017 10:48:18 +0000 (+0100) Subject: crush: do not erase non existent name X-Git-Tag: v12.0.1~135^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fb111a813c5da46c99fdfc6c62b76c48059750a4;p=ceph.git crush: do not erase non existent name Signed-off-by: Loic Dachary --- diff --git a/src/crush/CrushWrapper.cc b/src/crush/CrushWrapper.cc index 81e08d62b769..45c41596016d 100644 --- a/src/crush/CrushWrapper.cc +++ b/src/crush/CrushWrapper.cc @@ -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;