]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/bluestore: narrow boundary check for fiemap
authorxie xingguo <xie.xingguo@zte.com.cn>
Fri, 4 Nov 2016 06:47:53 +0000 (14:47 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Sat, 5 Nov 2016 00:26:07 +0000 (08:26 +0800)
By including off-by-one.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/bluestore/BlueStore.cc

index aa837b69488485403151d3331de9dc26e674f6bd..d7f3c9e35e3fff40ae5b51d59781c6e07d762557 100644 (file)
@@ -5379,7 +5379,7 @@ int BlueStore::fiemap(
             << " size 0x" << o->onode.size << std::dec << dendl;
 
     boost::intrusive::set<Extent>::iterator ep, eend;
-    if (offset > o->onode.size)
+    if (offset >= o->onode.size)
       goto out;
 
     if (offset + length > o->onode.size) {