]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crush: fix bucket_add_item() won't update weight-set simultaneously
authorxie xingguo <xie.xingguo@zte.com.cn>
Mon, 14 Aug 2017 06:13:59 +0000 (14:13 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Tue, 22 Aug 2017 14:14:27 +0000 (22:14 +0800)
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/crush/CrushWrapper.cc

index a5519e2d4aa55930d725ebf50aa1e6d0da5fd59d..dc97f7f1347c1ee0139ad28a18bd6794328903d9 100644 (file)
@@ -1747,8 +1747,8 @@ int CrushWrapper::bucket_add_item(crush_bucket *bucket, int item, int weight)
   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];