]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: log before assert in AvlAllocator 50319/head
authorIgor Fedotov <ifedotov@suse.com>
Wed, 16 Mar 2022 10:56:15 +0000 (13:56 +0300)
committerIgor Fedotov <igor.fedotov@croit.io>
Wed, 1 Mar 2023 09:36:00 +0000 (12:36 +0300)
Fixes: https://tracker.ceph.com/issues/54579
Signed-off-by: Igor Fedotov <igor.fedotov@croit.io>
(cherry picked from commit f8b3b9a3e48c166723d178029f950ac5753133ff)

src/os/bluestore/AvlAllocator.cc

index 72bff28948af9c1b4d99185bb60556df9934cced..a2d0b28ddb2686b5df4dc2f3dc316f126defe38a 100644 (file)
@@ -437,27 +437,27 @@ void AvlAllocator::dump(std::function<void(uint64_t offset, uint64_t length)> no
 
 void AvlAllocator::init_add_free(uint64_t offset, uint64_t length)
 {
-  if (!length)
-    return;
-  std::lock_guard l(lock);
-  ceph_assert(offset + length <= uint64_t(device_size));
   ldout(cct, 10) << __func__ << std::hex
                  << " offset 0x" << offset
                  << " length 0x" << length
                  << std::dec << dendl;
+  if (!length)
+    return;
+  std::lock_guard l(lock);
+  ceph_assert(offset + length <= uint64_t(device_size));
   _add_to_tree(offset, length);
 }
 
 void AvlAllocator::init_rm_free(uint64_t offset, uint64_t length)
 {
-  if (!length)
-    return;
-  std::lock_guard l(lock);
-  ceph_assert(offset + length <= uint64_t(device_size));
   ldout(cct, 10) << __func__ << std::hex
                  << " offset 0x" << offset
                  << " length 0x" << length
                  << std::dec << dendl;
+  if (!length)
+    return;
+  std::lock_guard l(lock);
+  ceph_assert(offset + length <= uint64_t(device_size));
   _remove_from_tree(offset, length);
 }