From: xie xingguo Date: Mon, 14 Aug 2017 07:57:07 +0000 (+0800) Subject: crush: fix bucket_adjust_item_weight() won't update weight-set correctly X-Git-Tag: v12.2.0~15^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=63800be615f1b599a68fc61bbf41198f39d65ef8;p=ceph.git crush: fix bucket_adjust_item_weight() won't update weight-set correctly Signed-off-by: xie xingguo (cherry picked from commit d62c9f16cba5fef991b8405d3002da1c0a0ae090) --- diff --git a/src/crush/CrushWrapper.cc b/src/crush/CrushWrapper.cc index 006c20f2e1e..985c426b7c3 100644 --- a/src/crush/CrushWrapper.cc +++ b/src/crush/CrushWrapper.cc @@ -1678,8 +1678,8 @@ int CrushWrapper::bucket_adjust_item_weight(CephContext *cct, crush_bucket *buck if (bucket->items[position] == item) break; assert(position != bucket->size); - for (auto w : choose_args) { - crush_choose_arg_map arg_map = w.second; + for (auto &w : choose_args) { + crush_choose_arg_map &arg_map = w.second; crush_choose_arg *arg = &arg_map.args[-1-bucket->id]; for (__u32 j = 0; j < arg->weight_set_size; j++) { crush_weight_set *weight_set = &arg->weight_set[j];