]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: fix block extents issue of rwl writeback cache 33712/head
authorYuan Lu <yuan.y.lu@intel.com>
Wed, 4 Mar 2020 06:48:53 +0000 (14:48 +0800)
committerYuan Lu <yuan.y.lu@intel.com>
Wed, 4 Mar 2020 07:11:54 +0000 (15:11 +0800)
Signed-off-by: Lu, Yuan <yuan.y.lu@intel.com>
src/librbd/cache/rwl/Types.cc
src/librbd/cache/rwl/Types.h

index 3ad62176f0d2b84043b1b31d522182d97d2c9463..bd1b097c2e712b2ac0be43ce336a8737023dda6c 100644 (file)
@@ -38,7 +38,7 @@ void DeferredContexts::add(Context* ctx) {
 BlockExtent convert_to_block_extent(const uint64_t offset_bytes, const uint64_t length_bytes)
 {
   return BlockExtent(offset_bytes,
-                     offset_bytes + length_bytes - 1);
+                     offset_bytes + length_bytes);
 }
 
 BlockExtent WriteLogPmemEntry::block_extent() {
index ac300a8b38a57331762a1132c2a37a8f7571b765..6bfceea0a51878a0069989d1bbe220177fc44b99 100644 (file)
@@ -234,7 +234,7 @@ struct WriteBufferAllocation {
 
 static inline io::Extent image_extent(const BlockExtent& block_extent) {
   return io::Extent(block_extent.block_start,
-                    block_extent.block_end - block_extent.block_start + 1);
+                    block_extent.block_end - block_extent.block_start);
 }
 
 template <typename ExtentsType>