From: xie xingguo Date: Fri, 18 Aug 2017 02:25:13 +0000 (+0800) Subject: crush: rebuild shadow trees on removing crush rule X-Git-Tag: v12.2.0~17^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=59f58216bf49a72e4879a3478a88d79f7aafb0fa;p=ceph.git 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) --- diff --git a/src/crush/CrushWrapper.cc b/src/crush/CrushWrapper.cc index 76c6afe60a5c..26954b8dee6d 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)