From: Avner BenHanoch Date: Wed, 17 Feb 2016 16:52:33 +0000 (+0200) Subject: mds: don't crash because of bad ms-type in ceph.conf (or missing enablement for exper... X-Git-Tag: v10.1.0~284^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cb928f5f43e570092a4d26ae90456356bf1b81d2;p=ceph.git mds: don't crash because of bad ms-type in ceph.conf (or missing enablement for experimental ms-type) 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 --- diff --git a/src/ceph_mds.cc b/src/ceph_mds.cc index 08eee5e03135..fda5a3771570 100644 --- a/src/ceph_mds.cc +++ b/src/ceph_mds.cc @@ -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()