]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: don't crash because of bad ms-type in ceph.conf (or missing enablement for exper... 7650/head
authorAvner BenHanoch <avnerb@mellanox.com>
Wed, 17 Feb 2016 16:52:33 +0000 (18:52 +0200)
committerAvner BenHanoch <avnerb@mellanox.com>
Wed, 17 Feb 2016 16:52:33 +0000 (18:52 +0200)
missing nullity check will cause the process to crash in the following cases:
 a. bad ms-type is configured in ceph.conf
 b. an experimental ms-type is configured (ms-type-async or ms-type-xio) without explicitly enabling the experimental feature in ceph.conf
 c. ms-type is configured to "random" and at runtime the random feature yields ms-type which is an experimental feature while in ceph.conf this experimental feature was not explicitly enabled

Signed-off-by: Avner BenHanoch <avnerb@mellanox.com>
src/ceph_mds.cc

index 08eee5e03135aa0ff51ba26120626df394fc57c8..fda5a37715707a421a474eb0ca0aace697e495ed 100644 (file)
@@ -160,6 +160,8 @@ int main(int argc, const char **argv)
   Messenger *msgr = Messenger::create(g_ceph_context, g_conf->ms_type,
                                      entity_name_t::MDS(-1), "mds",
                                      getpid());
+  if (!msgr)
+    exit(1);
   msgr->set_cluster_protocol(CEPH_MDS_PROTOCOL);
 
   cout << "starting " << g_conf->name << " at " << msgr->get_myaddr()