]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: take heartbeat_lock when calling heartbeat() 28220/head
authorSage Weil <sage@redhat.com>
Tue, 23 Apr 2019 18:03:42 +0000 (13:03 -0500)
committerPrashant D <pdhange@redhat.com>
Thu, 23 May 2019 06:45:31 +0000 (02:45 -0400)
Fixes: http://tracker.ceph.com/issues/39439
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 7863d7c6c49347db97a6bca36f63fc35741ac0e5)

Conflicts:
src/osd/OSD.cc : Resolved in _preboot

src/osd/OSD.cc

index 49de7ba5030b3c543c6c2d307a88990a0b73b855..9fc71e774c2bf411f7c2bcaf0341f6dae9f65aa2 100644 (file)
@@ -4693,6 +4693,7 @@ void OSD::heartbeat_check()
 
 void OSD::heartbeat()
 {
+  ceph_assert(heartbeat_lock.is_locked_by_me());
   dout(30) << "heartbeat" << dendl;
 
   // get CPU load avg
@@ -5312,7 +5313,10 @@ void OSD::_preboot(epoch_t oldest, epoch_t newest)
           << oldest << ".." << newest << dendl;
 
   // ensure our local fullness awareness is accurate
-  heartbeat();
+  {
+    Mutex::Locker l(heartbeat_lock);
+    heartbeat();
+  }
 
   // if our map within recent history, try to add ourselves to the osdmap.
   if (osdmap->get_epoch() == 0) {