]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix a damaged() case
authorJohn Spray <john.spray@redhat.com>
Wed, 20 May 2015 10:52:21 +0000 (11:52 +0100)
committerJohn Spray <john.spray@redhat.com>
Thu, 18 Jun 2015 10:19:44 +0000 (11:19 +0100)
Neglected to take lock around this call.

Signed-off-by: John Spray <john.spray@redhat.com>
src/mds/MDLog.cc

index 9a0f8442a7656be734b9da742d72d7b9d4ce985e..4c22e7e4a92aacdde1ecc47459acb0fad670fc1d 100644 (file)
@@ -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()
       }