From: John Spray Date: Wed, 20 May 2015 10:52:21 +0000 (+0100) Subject: mds: fix a damaged() case X-Git-Tag: v9.0.3~132^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e9642077722c8ac5030cbe5efbcc32aa992cc4e6;p=ceph.git mds: fix a damaged() case Neglected to take lock around this call. Signed-off-by: John Spray --- diff --git a/src/mds/MDLog.cc b/src/mds/MDLog.cc index 9a0f8442a765..4c22e7e4a92a 100644 --- a/src/mds/MDLog.cc +++ b/src/mds/MDLog.cc @@ -847,7 +847,9 @@ void MDLog::_recovery_thread(MDSInternalContextBase *completion) } else if (read_result != 0) { mds->clog->error() << "failed to read JournalPointer: " << read_result << " (" << cpp_strerror(read_result) << ")"; + mds->mds_lock.Lock(); mds->damaged(); + mds->mds_lock.Unlock(); assert(0); // Should be unreachable because damaged() calls respawn() } @@ -1148,7 +1150,9 @@ void MDLog::_replay_thread() r = -EAGAIN; } else { mds->clog->error() << "missing journal object"; + mds->mds_lock.Lock(); mds->damaged(); + mds->mds_lock.Unlock(); assert(0); // Should be unreachable because damaged() calls respawn() } } else if (r == -EINVAL) { @@ -1159,7 +1163,9 @@ void MDLog::_replay_thread() r = -EAGAIN; } else { mds->clog->error() << "invalid journaler offsets"; + mds->mds_lock.Lock(); mds->damaged(); + mds->mds_lock.Unlock(); assert(0); // Should be unreachable because damaged() calls respawn() } } else { @@ -1182,7 +1188,9 @@ void MDLog::_replay_thread() << dendl; mds->clog->error() << "error reading journal header"; + mds->mds_lock.Lock(); mds->damaged(); + mds->mds_lock.Unlock(); assert(0); // Should be unreachable because damaged() calls // respawn() } @@ -1226,7 +1234,9 @@ void MDLog::_replay_thread() if (g_conf->mds_log_skip_corrupt_events) { continue; } else { + mds->mds_lock.Lock(); mds->damaged(); + mds->mds_lock.Unlock(); assert(0); // Should be unreachable because damaged() calls // respawn() }