]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osdc: fix mutex assert for !debug builds 60026/head
authorPatrick Donnelly <pdonnell@redhat.com>
Fri, 27 Sep 2024 12:13:23 +0000 (08:13 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Fri, 27 Sep 2024 12:16:32 +0000 (08:16 -0400)
Fixes: 55652f0819761d410bddcf3688b1c3e10ed64f5b
Fixes: https://tracker.ceph.com/issues/68291
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/osdc/Journaler.h

index 5e1677de7c04d7eb0968b8c4849f27ba2b1d2aef..4a574ed66d94e14f8747ff8ceca3da764e32d91a 100644 (file)
@@ -529,43 +529,43 @@ public:
   // ===================
 
   Header get_last_committed() const {
-    ceph_assert(!ceph_mutex_is_locked_by_me(lock));
+    ceph_assert(!ceph::mutex_debugging || !ceph_mutex_is_locked_by_me(lock));
     lock_guard l(lock);
     return last_committed;
   }
   Header get_last_written() const {
-    ceph_assert(!ceph_mutex_is_locked_by_me(lock));
+    ceph_assert(!ceph::mutex_debugging || !ceph_mutex_is_locked_by_me(lock));
     lock_guard l(lock);
     return last_written;
   }
 
   uint64_t get_layout_period() const {
-    ceph_assert(!ceph_mutex_is_locked_by_me(lock));
+    ceph_assert(!ceph::mutex_debugging || !ceph_mutex_is_locked_by_me(lock));
     lock_guard l(lock);
     return layout.get_period();
   }
   file_layout_t get_layout() const {
-    ceph_assert(!ceph_mutex_is_locked_by_me(lock));
+    ceph_assert(!ceph::mutex_debugging || !ceph_mutex_is_locked_by_me(lock));
     lock_guard l(lock);
     return layout;
   }
   bool is_active() const {
-    ceph_assert(!ceph_mutex_is_locked_by_me(lock));
+    ceph_assert(!ceph::mutex_debugging || !ceph_mutex_is_locked_by_me(lock));
     lock_guard l(lock);
     return state == STATE_ACTIVE;
   }
   bool is_stopping() const {
-    ceph_assert(!ceph_mutex_is_locked_by_me(lock));
+    ceph_assert(!ceph::mutex_debugging || !ceph_mutex_is_locked_by_me(lock));
     lock_guard l(lock);
     return state == STATE_STOPPING;
   }
   int get_error() const {
-    ceph_assert(!ceph_mutex_is_locked_by_me(lock));
+    ceph_assert(!ceph::mutex_debugging || !ceph_mutex_is_locked_by_me(lock));
     lock_guard l(lock);
     return error;
   }
   bool is_readonly() const {
-    ceph_assert(!ceph_mutex_is_locked_by_me(lock));
+    ceph_assert(!ceph::mutex_debugging || !ceph_mutex_is_locked_by_me(lock));
     lock_guard l(lock);
     return readonly;
   }
@@ -573,32 +573,32 @@ public:
   bool _is_readable();
   bool try_read_entry(bufferlist& bl);
   uint64_t get_write_pos() const {
-    ceph_assert(!ceph_mutex_is_locked_by_me(lock));
+    ceph_assert(!ceph::mutex_debugging || !ceph_mutex_is_locked_by_me(lock));
     lock_guard l(lock);
     return write_pos;
   }
   uint64_t get_write_safe_pos() const {
-    ceph_assert(!ceph_mutex_is_locked_by_me(lock));
+    ceph_assert(!ceph::mutex_debugging || !ceph_mutex_is_locked_by_me(lock));
     lock_guard l(lock);
     return safe_pos;
   }
   uint64_t get_read_pos() const {
-    ceph_assert(!ceph_mutex_is_locked_by_me(lock));
+    ceph_assert(!ceph::mutex_debugging || !ceph_mutex_is_locked_by_me(lock));
     lock_guard l(lock);
     return read_pos;
   }
   uint64_t get_expire_pos() const {
-    ceph_assert(!ceph_mutex_is_locked_by_me(lock));
+    ceph_assert(!ceph::mutex_debugging || !ceph_mutex_is_locked_by_me(lock));
     lock_guard l(lock);
     return expire_pos;
   }
   uint64_t get_trimmed_pos() const {
-    ceph_assert(!ceph_mutex_is_locked_by_me(lock));
+    ceph_assert(!ceph::mutex_debugging || !ceph_mutex_is_locked_by_me(lock));
     lock_guard l(lock);
     return trimmed_pos;
   }
   size_t get_journal_envelope_size() const { 
-    ceph_assert(!ceph_mutex_is_locked_by_me(lock));
+    ceph_assert(!ceph::mutex_debugging || !ceph_mutex_is_locked_by_me(lock));
     lock_guard l(lock);
     return journal_stream.get_envelope_size(); 
   }