]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: check do_shutdown before do_restart 6547/head
authorXiaoxi Chen <xiaoxi.chen@intel.com>
Thu, 12 Nov 2015 05:46:58 +0000 (13:46 +0800)
committerXiaoxi Chen <xiaoxi.chen@intel.com>
Thu, 12 Nov 2015 05:48:16 +0000 (13:48 +0800)
This will save extart boot message when do_shutdown && do_restart == true,
which is the case when rebind failed.

Also move the unlock/lock inside the if statement so we don't do unnecessary
lock/unlock.

Signed-off-by: Xiaoxi Chen <xiaoxi.chen@intel.com>
src/osd/OSD.cc

index 0562eed8f3a88f5432d2ec4949de0cf49c394c45..ae028a225c0a1048e4adc497d2ed02fbc6ade82f 100644 (file)
@@ -6544,16 +6544,17 @@ void OSD::handle_osd_map(MOSDMap *m)
     dout(10) << " msg say newest map is " << m->newest_map << ", requesting more" << dendl;
     osdmap_subscribe(osdmap->get_epoch()+1, true);
   }
+  else if (do_shutdown) {
+    osd_lock.Unlock();
+    shutdown();
+    osd_lock.Lock();
+  }
   else if (is_booting()) {
     start_boot();  // retry
   }
   else if (do_restart)
     start_boot();
 
-  osd_lock.Unlock();
-  if (do_shutdown)
-    shutdown();
-  osd_lock.Lock();
 
   m->put();
 }