From 84aa28aaa02284617588b564a775dec744b1079d Mon Sep 17 00:00:00 2001 From: John Spray Date: Tue, 14 Jun 2016 17:16:24 +0100 Subject: [PATCH] mds: fix MDLog recovery rare case This handled the case where one daemon saw a log that was partially rewritten by another. It was calling the context incorrectly (without mds_lock held) Fixes: http://tracker.ceph.com/issues/16298 Signed-off-by: John Spray --- src/mds/MDLog.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mds/MDLog.cc b/src/mds/MDLog.cc index 795ffb3f5b291..e4999a4b90aa4 100644 --- a/src/mds/MDLog.cc +++ b/src/mds/MDLog.cc @@ -924,6 +924,10 @@ void MDLog::_recovery_thread(MDSInternalContextBase *completion) if (mds->is_standby_replay()) { dout(1) << "Journal " << jp.front << " is being rewritten, " << "cannot replay in standby until an active MDS completes rewrite" << dendl; + Mutex::Locker l(mds->mds_lock); + if (mds->is_daemon_stopping()) { + return; + } completion->complete(-EAGAIN); return; } -- 2.39.5