summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-10-01 15:53:42 -0700
committerSage Weil <sage@inktank.com>2013-10-01 15:53:42 -0700
commit9b7a2ae329b6a511064dd3d6e549ba61f52cfd21 (patch)
tree47d09dfdefc1f79885e14696ad8c0579b644d71b
parent26235e49844b19e5f4d3b95130f8f958a66924ec (diff)
downloadceph-9b7a2ae329b6a511064dd3d6e549ba61f52cfd21.tar.gz
crush: invalidate rmap on create (and thus decode)
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>
-rw-r--r--src/crush/CrushWrapper.cc1
-rw-r--r--src/crush/CrushWrapper.h1
2 files changed, 1 insertions, 1 deletions
diff --git a/src/crush/CrushWrapper.cc b/src/crush/CrushWrapper.cc
index e96e6123aab..7ea4a8e24e1 100644
--- a/src/crush/CrushWrapper.cc
+++ b/src/crush/CrushWrapper.cc
@@ -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()) {
diff --git a/src/crush/CrushWrapper.h b/src/crush/CrushWrapper.h
index 3d07a281956..eeb93796adb 100644
--- a/src/crush/CrushWrapper.h
+++ b/src/crush/CrushWrapper.h
@@ -94,6 +94,7 @@ public:
crush_destroy(crush);
crush = crush_create();
assert(crush);
+ have_rmaps = false;
}
// tunables