]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
lockdep: reset state on shutdown 1592/head
authorSage Weil <sage@inktank.com>
Wed, 2 Apr 2014 23:43:10 +0000 (16:43 -0700)
committerSage Weil <sage@inktank.com>
Wed, 2 Apr 2014 23:46:33 +0000 (16:46 -0700)
If we shut down, clear out all of the lockdep state.  This ensures that if
we start up again on another cct, we will not be confused by old type ids
and dependency state.

Possibly contributed to #7965.

Signed-off-by: Sage Weil <sage@inktank.com>
src/common/lockdep.cc

index e4376eaeda449a90eb51f4954da33549415e477b..6a8a1fa4cf0188bf527dfc5f73a09a7bbe7de335 100644 (file)
@@ -76,6 +76,15 @@ void lockdep_unregister_ceph_context(CephContext *cct)
     // this cct is going away; shut it down!
     g_lockdep = false;
     g_lockdep_ceph_ctx = NULL;
+
+    // blow away all of our state, too, in case it starts up again.
+    held.clear();
+    for (unsigned i = 0; i < MAX_LOCKS; ++i)
+      for (unsigned j = 0; j < MAX_LOCKS; ++j)
+       follows[i][j] = NULL;
+    lock_names.clear();
+    lock_ids.clear();
+    last_id = 0;
   }
   pthread_mutex_unlock(&lockdep_mutex);
 }