]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
log: fix locking typo/stupid for dump_recent()
authorSage Weil <sage@inktank.com>
Wed, 2 Jan 2013 21:58:44 +0000 (13:58 -0800)
committerSage Weil <sage@inktank.com>
Thu, 3 Jan 2013 03:58:13 +0000 (19:58 -0800)
We weren't locking m_flush_mutex properly, which in turn was leading to
racing threads calling dump_recent() and garbling the crash dump output.

Backport: bobtail, argonaut
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
(cherry picked from commit 43cba617aa0247d714632bddf31b9271ef3a1b50)

src/log/Log.cc

index 51a340ffcb17c2d0d3370ebc5db6799a5fd75754..b8dd31fd51bdb225c233770e07551ab0dd0d4598 100644 (file)
@@ -248,7 +248,7 @@ void Log::_log_message(const char *s, bool crash)
 
 void Log::dump_recent()
 {
-  pthread_mutex_unlock(&m_flush_mutex);
+  pthread_mutex_lock(&m_flush_mutex);
 
   pthread_mutex_lock(&m_queue_mutex);
   EntryQueue t;