]> 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)
committerxie xingguo <xie.xingguo@zte.com.cn>
Tue, 22 Aug 2017 14:45:49 +0000 (22:45 +0800)
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
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];