]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
objecter: Unlock in shutdown before waiting for timer thread
authorDavid Zafman <dzafman@redhat.com>
Tue, 21 Oct 2014 07:52:37 +0000 (00:52 -0700)
committerSage Weil <sage@redhat.com>
Tue, 21 Oct 2014 17:38:54 +0000 (10:38 -0700)
Fixes: #9845
Reviewed-by: Sage Weil <sage@redhat.com>
Signed-off-by: David Zafman <dzafman@redhat.com>
src/osdc/Objecter.cc

index d1d1665e07fdba095b35209a09b3102297e8dacb..035127acc99ce1f89d96231ad38fd372c4baffb8 100644 (file)
@@ -292,7 +292,7 @@ void Objecter::shutdown()
 {
   assert(initialized.read());
 
-  RWLock::WLocker wl(rwlock);
+  rwlock.get_write();
 
   initialized.set(0);
 
@@ -392,6 +392,9 @@ void Objecter::shutdown()
     logger = NULL;
   }
 
+  // Let go of Objecter write lock so timer thread can shutdown
+  rwlock.unlock();
+
   {
     Mutex::Locker l(timer_lock);
     timer.shutdown();
@@ -1543,15 +1546,15 @@ void Objecter::tick()
 
   ldout(cct, 10) << "tick" << dendl;
 
-  // we are only called by C_Tick
-  assert(tick_event);
-  tick_event = NULL;
-
   if (!initialized.read()) {
     // we raced with shutdown
     return;
   }
 
+  // we are only called by C_Tick
+  assert(tick_event);
+  tick_event = NULL;
+
   set<OSDSession*> toping;
 
   int r = 0;