crush: fix bucket_remove_item() won't update weight-set simultaneously

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
This commit is contained in:
xie xingguo 2017-08-14 14:15:53 +08:00
parent 475bddab51
commit 0e1d37f6f3

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