]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: don't try to flush journal on inactive mds
authorJohn Spray <john.spray@redhat.com>
Thu, 29 Jan 2015 12:15:29 +0000 (12:15 +0000)
committerJohn Spray <john.spray@redhat.com>
Tue, 17 Feb 2015 14:23:22 +0000 (14:23 +0000)
This would segfault if run on MDS in replay (asok
commands in general are permitted as soon as an MDS
gets a rank rather than waiting for it to be active)

Signed-off-by: John Spray <john.spray@redhat.com>
src/mds/MDS.cc

index 69d6be05a4953e64e2e4a0a55a25b5fcb6a54d6c..f9d7ae6e7f4663b4bd11dc232e62786abfb4b6de 100644 (file)
@@ -419,6 +419,11 @@ int MDS::_command_flush_journal(std::stringstream *ss)
     return -EROFS;
   }
 
+  if (!is_active()) {
+    dout(5) << __func__ << ": MDS not active, no-op" << dendl;
+    return 0;
+  }
+
   // I need to seal off the current segment, and then mark all previous segments
   // for expiry
   mdlog->start_new_segment();