]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
do not return non-exist extents when doing sparse read 4684/head
authorxinxin shu <xinxin.shu@intel.com>
Thu, 14 May 2015 19:36:37 +0000 (03:36 +0800)
committerxinxin shu <xinxin.shu@intel.com>
Thu, 14 May 2015 19:39:10 +0000 (03:39 +0800)
Signed-off-by: xinxin shu <xinxin.shu@intel.com>
src/os/KeyValueStore.cc

index 589227f987f533c2314b334f7b4cae9a3ec3737f..1629b1797125356440b38d9d866f99a25ad2a566 100644 (file)
@@ -1730,8 +1730,10 @@ int KeyValueStore::fiemap(coll_t cid, const ghobject_t& oid,
   map<uint64_t, uint64_t> m;
   for (vector<StripObjectMap::StripExtent>::iterator iter = extents.begin();
        iter != extents.end(); ++iter) {
-    uint64_t off = iter->no * header->strip_size + iter->offset;
-    m[off] = iter->len;
+    if (header->bits[iter->no]) {
+      uint64_t off = iter->no * header->strip_size + iter->offset;
+      m[off] = iter->len;
+    }
   }
   ::encode(m, bl);
   return 0;