From: xinxin shu Date: Thu, 14 May 2015 19:36:37 +0000 (+0800) Subject: do not return non-exist extents when doing sparse read X-Git-Tag: v9.0.2~150^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F4684%2Fhead;p=ceph.git do not return non-exist extents when doing sparse read Signed-off-by: xinxin shu --- diff --git a/src/os/KeyValueStore.cc b/src/os/KeyValueStore.cc index 589227f987f5..1629b1797125 100644 --- a/src/os/KeyValueStore.cc +++ b/src/os/KeyValueStore.cc @@ -1730,8 +1730,10 @@ int KeyValueStore::fiemap(coll_t cid, const ghobject_t& oid, map m; for (vector::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;