]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: pass monclient::init errors up the stack
authorSage Weil <sage@newdream.net>
Fri, 11 Nov 2011 20:52:24 +0000 (12:52 -0800)
committerSage Weil <sage@newdream.net>
Fri, 11 Nov 2011 20:52:24 +0000 (12:52 -0800)
Fixes crash like

 ceph version 0.38-149-gbf254de (commit:bf254de5cf8a17ce9467d166d87f3ab93170ae13)
 1: (ceph::BackTrace::BackTrace(int)+0x2d) [0x91d97b]
 2: ./ceph-osd() [0xa05baa]
 3: (()+0xef60) [0x7fb54c87ef60]
 4: (std::_Rb_tree<unsigned int, unsigned int, std::_Identity<unsigned int>, std::less<unsigned int>, std::allocator<unsigned int> >::size() const+0xc) [0x8a4bc6]
 5: (std::set<unsigned int, std::less<unsigned int>, std::allocator<unsigned int> >::size() const+0x18) [0x8a1d32]
 6: (void encode<unsigned int>(std::set<unsigned int, std::less<unsigned int>, std::allocator<unsigned int> > const&, ceph::buffer::list&)+0x1c) [0x8a0311]
 7: (MonClient::_reopen_session()+0x2c5) [0x89a425]
 8: (MonClient::authenticate(double)+0x24f) [0x898da7]
 9: (OSD::init()+0x112b) [0x807ca1]
 10: (main()+0x2c09) [0x73e406]
 11: (__libc_start_main()+0xfd) [0x7fb54b04ec4d]
 12: ./ceph-osd() [0x73b499]

due to auth_supported being NULL.

Signed-off-by: Sage Weil <sage@newdream.net>
src/osd/OSD.cc

index 0db64253fc0745f0b154f13d0b98f8e96c76fd01..e2428e7f5f85965a1e5935b532d2a2621d694a05 100644 (file)
@@ -703,7 +703,9 @@ int OSD::init()
   hbout_messenger->add_dispatcher_head(&heartbeat_dispatcher);
 
   monc->set_want_keys(CEPH_ENTITY_TYPE_MON | CEPH_ENTITY_TYPE_OSD);
-  monc->init();
+  r = monc->init();
+  if (r < 0)
+    return r;
 
   // tell monc about log_client so it will know about mon session resets
   monc->set_log_client(&clog);