From: xie xingguo Date: Mon, 14 Aug 2017 06:15:53 +0000 (+0800) Subject: crush: fix bucket_remove_item() won't update weight-set simultaneously X-Git-Tag: v13.0.0~13^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0e1d37f6f3160cda9fe3578b21ff002d9ebe5b36;p=ceph.git crush: fix bucket_remove_item() won't update weight-set simultaneously Signed-off-by: xie xingguo --- diff --git a/src/crush/CrushWrapper.cc b/src/crush/CrushWrapper.cc index dc97f7f1347c..1dbcc3d6f381 100644 --- a/src/crush/CrushWrapper.cc +++ b/src/crush/CrushWrapper.cc @@ -1780,8 +1780,8 @@ int CrushWrapper::bucket_remove_item(crush_bucket *bucket, int item) if (r < 0) { return r; } - 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];