From 076575909d76da32ae1fdadd882b12ad54075169 Mon Sep 17 00:00:00 2001 From: Changcheng Liu Date: Wed, 26 Aug 2020 10:21:48 +0800 Subject: [PATCH] osd/OSDMap: use class member instead of parameter to reset container size Signed-off-by: Changcheng Liu --- src/osd/OSDMap.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index cd920f8884473..47eed2e0a048d 100644 --- a/src/osd/OSDMap.cc +++ b/src/osd/OSDMap.cc @@ -1366,21 +1366,21 @@ void OSDMap::set_max_osd(int m) { int o = max_osd; max_osd = m; - osd_state.resize(m); - osd_weight.resize(m); + osd_state.resize(max_osd); + osd_weight.resize(max_osd); for (; oclient_addrs.resize(m); - osd_addrs->cluster_addrs.resize(m); - osd_addrs->hb_back_addrs.resize(m); - osd_addrs->hb_front_addrs.resize(m); - osd_uuid->resize(m); + osd_info.resize(max_osd); + osd_xinfo.resize(max_osd); + osd_addrs->client_addrs.resize(max_osd); + osd_addrs->cluster_addrs.resize(max_osd); + osd_addrs->hb_back_addrs.resize(max_osd); + osd_addrs->hb_front_addrs.resize(max_osd); + osd_uuid->resize(max_osd); if (osd_primary_affinity) - osd_primary_affinity->resize(m, CEPH_OSD_DEFAULT_PRIMARY_AFFINITY); + osd_primary_affinity->resize(max_osd, CEPH_OSD_DEFAULT_PRIMARY_AFFINITY); calc_num_osds(); } -- 2.39.5