register_perf_counters was called before m_image_spec initialization
resulting in UB in the perf counters' name.
This moves the register_perf_counters() call to the init function
after the m_image_spec initialization.
Fixes: https://tracker.ceph.com/issues/49959
Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>
(cherry picked from commit
5e3b9d29b3a81923fed51248aa21749dbecfcd73)
m_lock(ceph::make_mutex(librbd::util::unique_lock_name(
"rbd::mirror::image_replayer::journal::Replayer", this))) {
dout(10) << dendl;
-
- {
- std::unique_lock locker{m_lock};
- register_perf_counters();
- }
}
template <typename I>
local_image_ctx->name);
}
+ {
+ std::unique_lock locker{m_lock};
+ register_perf_counters();
+ }
+
ceph_assert(m_on_init_shutdown == nullptr);
m_on_init_shutdown = on_finish;