From d66fa53d13368a778e4c036b59e1574a9dfec8ec Mon Sep 17 00:00:00 2001 From: John Spray Date: Tue, 20 May 2014 11:00:52 +0100 Subject: [PATCH] tools/MDSUtility: fix crash on bad config Was calling messenger destructor before calling shutdown in case where config was bad, e.g. in vstart without "-c" flag. Signed-off-by: John Spray --- src/tools/cephfs/MDSUtility.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/tools/cephfs/MDSUtility.cc b/src/tools/cephfs/MDSUtility.cc index 5633c929bd472..4d6176aced056 100644 --- a/src/tools/cephfs/MDSUtility.cc +++ b/src/tools/cephfs/MDSUtility.cc @@ -54,8 +54,11 @@ int MDSUtility::init() messenger->start(); // Initialize MonClient - if (monc->build_initial_monmap() < 0) + if (monc->build_initial_monmap() < 0) { + messenger->shutdown(); + messenger->wait(); return -1; + } monc->set_want_keys(CEPH_ENTITY_TYPE_MON|CEPH_ENTITY_TYPE_OSD|CEPH_ENTITY_TYPE_MDS); monc->set_messenger(messenger); @@ -63,6 +66,9 @@ int MDSUtility::init() r = monc->authenticate(); if (r < 0) { derr << "Authentication failed, did you specify an MDS ID with a valid keyring?" << dendl; + monc->shutdown(); + messenger->shutdown(); + messenger->wait(); return r; } -- 2.39.5