]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Fix keyvaluestore fiemap bug 1912/head
authorHaomai Wang <haomaiwang@gmail.com>
Wed, 4 Jun 2014 04:58:07 +0000 (12:58 +0800)
committerHaomai Wang <haomaiwang@gmail.com>
Wed, 4 Jun 2014 09:19:36 +0000 (17:19 +0800)
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 <haomaiwang@gmail.com>
src/os/KeyValueStore.cc

index d1642edf0ade9593da2cc312769b130768675ae3..f2e3f9137809a752414d724970e1322fb72d71e8 100644 (file)
@@ -1670,7 +1670,8 @@ 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) {
-    m[iter->offset] = iter->len;
+    uint64_t off = iter->no * header.strip_size + iter->offset;
+    m[off] = iter->len;
   }
   ::encode(m, bl);
   return 0;