From a46b333854684d94d864dd02e0e0d357e597e4ce Mon Sep 17 00:00:00 2001 From: xinxin shu Date: Fri, 15 May 2015 03:36:37 +0800 Subject: [PATCH] do not return non-exist extents when doing sparse read Signed-off-by: xinxin shu --- src/os/KeyValueStore.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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; -- 2.47.3