]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge PR #56148 into main
authorVenky Shankar <vshankar@redhat.com>
Mon, 13 May 2024 11:39:41 +0000 (17:09 +0530)
committerVenky Shankar <vshankar@redhat.com>
Mon, 13 May 2024 11:39:41 +0000 (17:09 +0530)
* refs/pull/56148/head:
cephfs_mirror: check m_instance_watcher and m_mirror_watcher before using them

Reviewed-by: Venky Shankar <vshankar@redhat.com>
1  2 
src/tools/cephfs_mirror/FSMirror.h

index aaba1cb9f3a757edda950a7db43517b76958d3c0,efc743a1414c97443a40d489636308f656e6c477..b106fdff8b60d4e61b9ca47e993c189e67b2c8a3
@@@ -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();