]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crush: fix bucket_adjust_item_weight() won't update weight-set correctly
authorxie xingguo <xie.xingguo@zte.com.cn>
Mon, 14 Aug 2017 07:57:07 +0000 (15:57 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 24 Aug 2017 02:01:31 +0000 (10:01 +0800)
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
(cherry picked from commit d62c9f16cba5fef991b8405d3002da1c0a0ae090)

src/crush/CrushWrapper.cc

index 006c20f2e1e24f877eed91bf315d46939d34ec77..985c426b7c30264aec64d8bfc6dfea20cbb21ebd 100644 (file)
@@ -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];