From: Yuan Lu Date: Wed, 4 Mar 2020 06:48:53 +0000 (+0800) Subject: librbd: fix block extents issue of rwl writeback cache X-Git-Tag: v16.0.0~64^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bb5d983029220e60657b6f4f56811984a74e0a31;p=ceph.git librbd: fix block extents issue of rwl writeback cache Signed-off-by: Lu, Yuan --- diff --git a/src/librbd/cache/rwl/Types.cc b/src/librbd/cache/rwl/Types.cc index 3ad62176f0d2..bd1b097c2e71 100644 --- a/src/librbd/cache/rwl/Types.cc +++ b/src/librbd/cache/rwl/Types.cc @@ -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() { diff --git a/src/librbd/cache/rwl/Types.h b/src/librbd/cache/rwl/Types.h index ac300a8b38a5..6bfceea0a518 100644 --- a/src/librbd/cache/rwl/Types.h +++ b/src/librbd/cache/rwl/Types.h @@ -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