Skip to content

Commit 54f7236

Browse files
authored
Merge pull request ceph#62754 from cbodley/wip-64895
common: CephContext::_refresh_perf_values() checks for null _mempool_perf Reviewed-by: Radoslaw Zarzynski <[email protected]>
2 parents 3feb479 + 76b3f01 commit 54f7236

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/common/ceph_context.cc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -999,11 +999,13 @@ void CephContext::_refresh_perf_values()
999999
_cct_perf->set(l_cct_total_workers, _heartbeat_map->get_total_workers());
10001000
_cct_perf->set(l_cct_unhealthy_workers, _heartbeat_map->get_unhealthy_workers());
10011001
}
1002-
unsigned l = l_mempool_first + 1;
1003-
for (unsigned i = 0; i < mempool::num_pools; ++i) {
1004-
mempool::pool_t& p = mempool::get_pool(mempool::pool_index_t(i));
1005-
_mempool_perf->set(l++, p.allocated_bytes());
1006-
_mempool_perf->set(l++, p.allocated_items());
1002+
if (_mempool_perf) {
1003+
unsigned l = l_mempool_first + 1;
1004+
for (unsigned i = 0; i < mempool::num_pools; ++i) {
1005+
mempool::pool_t& p = mempool::get_pool(mempool::pool_index_t(i));
1006+
_mempool_perf->set(l++, p.allocated_bytes());
1007+
_mempool_perf->set(l++, p.allocated_items());
1008+
}
10071009
}
10081010
}
10091011

0 commit comments

Comments
 (0)