From 5a426a1f1f34d3f5a510009cc3f3b219d3cbc74b Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 1 Oct 2013 15:53:42 -0700 Subject: [PATCH] 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 Reviewed-by: Joao Eduardo Luis (cherry picked from commit 9b7a2ae329b6a511064dd3d6e549ba61f52cfd21) --- src/crush/CrushWrapper.cc | 1 - src/crush/CrushWrapper.h | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crush/CrushWrapper.cc b/src/crush/CrushWrapper.cc index 1fc86893e1d04..ad0e8de0b24c4 100644 --- a/src/crush/CrushWrapper.cc +++ b/src/crush/CrushWrapper.cc @@ -835,7 +835,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 9109156d066d3..82bc0859bbdbd 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 -- 2.39.5