From: Venky Shankar Date: Mon, 13 May 2024 11:39:41 +0000 (+0530) Subject: Merge PR #56148 into main X-Git-Tag: testing/wip-vshankar-testing-20240515.171252-debug~25 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=5acc361312c1c3dbbee58323c160fd272bbe9159;p=ceph-ci.git Merge PR #56148 into main * refs/pull/56148/head: cephfs_mirror: check m_instance_watcher and m_mirror_watcher before using them Reviewed-by: Venky Shankar --- 5acc361312c1c3dbbee58323c160fd272bbe9159 diff --cc src/tools/cephfs_mirror/FSMirror.h index aaba1cb9f3a,efc743a1414..b106fdff8b6 --- a/src/tools/cephfs_mirror/FSMirror.h +++ b/src/tools/cephfs_mirror/FSMirror.h @@@ -47,12 -47,17 +47,17 @@@ public bool is_failed() { std::scoped_lock locker(m_lock); - return m_init_failed || - m_instance_watcher->is_failed() || - m_mirror_watcher->is_failed(); + bool failed = m_init_failed; + if (m_instance_watcher) { + failed |= m_instance_watcher->is_failed(); + } + if (m_mirror_watcher) { + failed |= m_mirror_watcher->is_failed(); + } + return failed; } - utime_t get_failed_ts() { + monotime get_failed_ts() { std::scoped_lock locker(m_lock); if (m_instance_watcher) { return m_instance_watcher->get_failed_ts();