]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
seastore: do assert if paddr type is not SEGMENT in add_relative
authormyoungwon oh <ohmyoungwon@gmail.com>
Thu, 12 May 2022 05:24:37 +0000 (14:24 +0900)
committermyoungwon oh <ohmyoungwon@gmail.com>
Thu, 19 May 2022 00:50:43 +0000 (09:50 +0900)
Signed-off-by: Myoungwon Oh <myoungwon.oh@samsung.com>
src/crimson/os/seastore/seastore_types.h

index a7ff94ac494500b27d5ae51a9d4f73e1da03130c..3bc0b0d923e8fcb73b7a10852675933cbe10954c 100644 (file)
@@ -684,14 +684,11 @@ struct blk_paddr_t : public paddr_t {
 
   paddr_t add_relative(paddr_t o) const {
     seastore_off_t off;
-    if (o.get_addr_type() == addr_types_t::SEGMENT) {
-      // segment addr is allocated when alloc_new_extent is called.
-      // But, if random block device is used,
-      // this eventually can be converted to blk addr after submit_record().
-      off = o.as_seg_paddr().get_segment_off();
-    } else {
-      off = o.as_blk_paddr().get_block_off();
-    }
+    ceph_assert(o.get_addr_type() == addr_types_t::SEGMENT);
+    // segment addr is allocated when alloc_new_extent is called.
+    // But, if random block device is used,
+    // segment-based relative addr needs to be added to block addr
+    off = o.as_seg_paddr().get_segment_off();
     return add_offset(off);
   }