]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: fix end_block calculation for read_iterate
authorJosh Durgin <josh.durgin@dreamhost.com>
Mon, 26 Sep 2011 21:13:44 +0000 (14:13 -0700)
committerJosh Durgin <josh.durgin@dreamhost.com>
Tue, 27 Sep 2011 01:10:40 +0000 (18:10 -0700)
All end block calculations match now.

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
src/librbd.cc

index 0192521aae75d677a3671055b813fbe2c733fdb1..a61fee96739cf458b9570dc77d3caf712af8ad1e 100644 (file)
@@ -1255,7 +1255,7 @@ int64_t read_iterate(ImageCtx *ictx, uint64_t off, size_t len,
   int64_t total_read = 0;
   ictx->lock.Lock();
   uint64_t start_block = get_block_num(ictx->header, off);
-  uint64_t end_block = get_block_num(ictx->header, off + len);
+  uint64_t end_block = get_block_num(ictx->header, off + len - 1);
   uint64_t block_size = get_block_size(ictx->header);
   ictx->lock.Unlock();
   uint64_t left = len;