From: Haomai Wang Date: Wed, 4 Jun 2014 04:58:07 +0000 (+0800) Subject: Fix keyvaluestore fiemap bug X-Git-Tag: v0.83~123^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1912%2Fhead;p=ceph.git Fix keyvaluestore fiemap bug The result of fiemap is wrong and the offset get from "StripObjectMap::file_to_extents" need to multiply by sequence number Signed-off-by: Haomai Wang --- diff --git a/src/os/KeyValueStore.cc b/src/os/KeyValueStore.cc index d1642edf0ade..f2e3f9137809 100644 --- a/src/os/KeyValueStore.cc +++ b/src/os/KeyValueStore.cc @@ -1670,7 +1670,8 @@ int KeyValueStore::fiemap(coll_t cid, const ghobject_t& oid, map m; for (vector::iterator iter = extents.begin(); iter != extents.end(); ++iter) { - m[iter->offset] = iter->len; + uint64_t off = iter->no * header.strip_size + iter->offset; + m[off] = iter->len; } ::encode(m, bl); return 0;