From: xie xingguo Date: Mon, 14 Aug 2017 06:19:09 +0000 (+0800) Subject: crush: update crush_choose_arg_map size on resizing X-Git-Tag: v13.0.0~13^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0c8ca02727b83c5bcbf896010e675762fdc333f5;p=ceph.git crush: update crush_choose_arg_map size on resizing Signed-off-by: xie xingguo --- diff --git a/src/crush/CrushWrapper.cc b/src/crush/CrushWrapper.cc index 1dbcc3d6f381..d95e8b8d6d04 100644 --- a/src/crush/CrushWrapper.cc +++ b/src/crush/CrushWrapper.cc @@ -1963,8 +1963,10 @@ int CrushWrapper::device_class_clone( unsigned new_size = -1-bno + 1; cmap.args = (crush_choose_arg*)realloc(cmap.args, new_size * sizeof(cmap.args[0])); + assert(cmap.args); memset(cmap.args + cmap.size, 0, (new_size - cmap.size) * sizeof(cmap.args[0])); + cmap.size = new_size; } auto& o = cmap.args[-1-original_id]; auto& n = cmap.args[-1-bno];