]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/cache: retire_extent_addr: add addr asserts
authorSamuel Just <sjust@redhat.com>
Fri, 27 Aug 2021 20:56:42 +0000 (13:56 -0700)
committerSamuel Just <sjust@redhat.com>
Sat, 28 Aug 2021 04:57:04 +0000 (04:57 +0000)
retire_extent_addr can only be called on absolute or record-relative
addrs.  Record-relative addrs are only valid on extents allocated as
part of the current transaction.

Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/os/seastore/cache.cc

index 2f1d1892cbf8d63e2c6f5505e2577db2a6fb564a..24eddfb2643fb1a5af86a452d7fa23975192c109 100644 (file)
@@ -38,6 +38,8 @@ Cache::~Cache()
 Cache::retire_extent_ret Cache::retire_extent_addr(
   Transaction &t, paddr_t addr, extent_len_t length)
 {
+  assert(addr.is_real() && !addr.is_block_relative());
+
   LOG_PREFIX(Cache::retire_extent);
   CachedExtentRef ext;
   auto result = t.get_extent(addr, &ext);
@@ -50,6 +52,9 @@ Cache::retire_extent_ret Cache::retire_extent_addr(
     ceph_abort();
   }
 
+  // any relative addr must have been on the transaction
+  assert(!addr.is_relative());
+
   // absent from transaction
   // retiring is not included by the cache hit metrics
   ext = query_cache(addr, nullptr);