]> git-server-git.apps.pok.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)
committerKefu Chai <kchai@redhat.com>
Thu, 24 Aug 2017 02:01:30 +0000 (10:01 +0800)
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
(cherry picked from commit 0e1d37f6f3160cda9fe3578b21ff002d9ebe5b36)

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];