]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crush: invalidate rmap on create (and thus decode)
authorSage Weil <sage@inktank.com>
Tue, 1 Oct 2013 22:53:42 +0000 (15:53 -0700)
committerSage Weil <sage@inktank.com>
Tue, 1 Oct 2013 22:53:42 +0000 (15:53 -0700)
If we have an existing CrushWrapper object and decode from a bufferlist,
reset build_rmaps so that they get rebuilt.

Remove the build_rmaps() all in decode that was useless on a redecode
(because have_rmaps == true in that case and it did nothing).

Fixes: #6442
Backport: dumpling, maybe cuttlefish
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
src/crush/CrushWrapper.cc
src/crush/CrushWrapper.h

index e96e6123aaba17c070547d72b550fd45331fcde7..7ea4a8e24e1d7f7fa5c3db262df162708e7b0f74 100644 (file)
@@ -855,7 +855,6 @@ void CrushWrapper::decode(bufferlist::iterator& blp)
     decode_32_or_64_string_map(type_map, blp);
     decode_32_or_64_string_map(name_map, blp);
     decode_32_or_64_string_map(rule_name_map, blp);
-    build_rmaps();
 
     // tunables
     if (!blp.end()) {
index 3d07a281956ed7830931e3ad5a962cf6f83f1cd8..eeb93796adbc47a0a8a7fec3acc6615862fc7f8e 100644 (file)
@@ -94,6 +94,7 @@ public:
       crush_destroy(crush);
     crush = crush_create();
     assert(crush);
+    have_rmaps = false;
   }
 
   // tunables