From 0e1d37f6f3160cda9fe3578b21ff002d9ebe5b36 Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Mon, 14 Aug 2017 14:15:53 +0800 Subject: [PATCH] crush: fix bucket_remove_item() won't update weight-set simultaneously Signed-off-by: xie xingguo --- src/crush/CrushWrapper.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/crush/CrushWrapper.cc b/src/crush/CrushWrapper.cc index dc97f7f1347c1..1dbcc3d6f381d 100644 --- a/src/crush/CrushWrapper.cc +++ b/src/crush/CrushWrapper.cc @@ -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]; -- 2.39.5