]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
OSD: avoid FileStore finisher deadlock in osd_lock when shutdown OSD 11052/head
authorHaomai Wang <haomai@xsky.com>
Mon, 12 Sep 2016 10:09:00 +0000 (18:09 +0800)
committerHaomai Wang <haomai@xsky.com>
Mon, 12 Sep 2016 10:09:00 +0000 (18:09 +0800)
When OSD receive signal to shutdown, it will try to call ObjectStore->flush
to make sure all pending IO done. But previous OSDMap committing IO may
complete Context in OSD::_committed_osd_maps which need to acquire osd_lock
firstly. So OSD shutdown thread need to wait for finisher done, and finisher
is acquiring osd_lock. dead lock happended

Signed-off-by: Haomai Wang <haomai@xsky.com>
src/osd/OSD.cc

index 3dc490fea8b28200a963f3b043314ac2cd8c64aa..a6017a780f3f69c166ae368936acebb635315cee 100644 (file)
@@ -6833,11 +6833,11 @@ void OSD::handle_osd_map(MOSDMap *m)
 void OSD::_committed_osd_maps(epoch_t first, epoch_t last, MOSDMap *m)
 {
   dout(10) << __func__ << " " << first << ".." << last << dendl;
-  Mutex::Locker l(osd_lock);
   if (is_stopping()) {
     dout(10) << __func__ << " bailing, we are shutting down" << dendl;
     return;
   }
+  Mutex::Locker l(osd_lock);
   map_lock.get_write();
 
   bool do_shutdown = false;