]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crush: fix bucket_remove_item() won't update weight-set simultaneously
authorxie xingguo <xie.xingguo@zte.com.cn>
Mon, 14 Aug 2017 06:15:53 +0000 (14:15 +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 dc97f7f1347c1ee0139ad28a18bd6794328903d9..1dbcc3d6f381df40aaade3b2d19880c9c1b58096 100644 (file)
@@ -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];