From 59f58216bf49a72e4879a3478a88d79f7aafb0fa Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Fri, 18 Aug 2017 10:25:13 +0800 Subject: [PATCH] crush: rebuild shadow trees on removing crush rule In case this is the last crush rule which is still referencing a specific device class. Otherwise the device class might stay hanging. Signed-off-by: xie xingguo (cherry picked from commit 968b72d8595996ee4d2e1364264c4c8203532045) --- src/crush/CrushWrapper.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crush/CrushWrapper.cc b/src/crush/CrushWrapper.cc index 76c6afe60a5..26954b8dee6 100644 --- a/src/crush/CrushWrapper.cc +++ b/src/crush/CrushWrapper.cc @@ -1667,7 +1667,7 @@ int CrushWrapper::remove_rule(int ruleno) crush->rules[ruleno] = NULL; rule_name_map.erase(ruleno); have_rmaps = false; - return 0; + return rebuild_roots_with_classes(); } int CrushWrapper::bucket_adjust_item_weight(CephContext *cct, crush_bucket *bucket, int item, int weight) -- 2.47.3