Skip to content

Commit

Permalink
cephfs_mirror: initialize m_timer_lock for scheduled fs mirror updates
Browse files Browse the repository at this point in the history
This prevents dereferencing a nullptr or inaccessible m_timer_lock.

Fixes: https://tracker.ceph.com/issues/64751
Signed-off-by: Jos Collin <jcollin@redhat.com>
  • Loading branch information
joscollin committed Mar 13, 2024
1 parent d7353ad commit f471736
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/tools/cephfs_mirror/Mirror.cc
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,9 @@ void Mirror::schedule_mirror_update_task() {

m_timer_task = new LambdaContext([this](int _) {
m_timer_task = nullptr;
auto safe_timer = &(m_cct->lookup_or_create_singleton_object<SafeTimerSingleton>
("cephfs::mirror::safe_timer", false, m_cct));
m_timer_lock = &safe_timer->timer_lock;
update_fs_mirrors();
});
double after = g_ceph_context->_conf.get_val<std::chrono::seconds>
Expand Down

0 comments on commit f471736

Please sign in to comment.