]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix stripe_size calculation 1780/head
authorYehuda Sadeh <yehuda@inktank.com>
Tue, 6 May 2014 23:55:27 +0000 (16:55 -0700)
committerYehuda Sadeh <yehuda@inktank.com>
Tue, 6 May 2014 23:55:27 +0000 (16:55 -0700)
Fixes: #8299
Backport: firefly
The stripe size calculation was broken, specifically affected cases
where we had manifest that described multiple parts.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
src/rgw/rgw_rados.cc

index 0ea7057f5bd584c578b31fc24c2ab84243b4e669..0c1f7cba2643708f98435ea99ec1d74269efee90 100644 (file)
@@ -597,8 +597,8 @@ void RGWObjManifest::obj_iterator::seek(uint64_t o)
     stripe_size = rule.stripe_max_size;
     stripe_size = MIN(manifest->get_obj_size() - stripe_ofs, stripe_size);
   } else {
-    stripe_size = rule.part_size - (ofs - stripe_ofs);
-    stripe_size = MIN(stripe_size, rule.stripe_max_size);
+    uint64_t next = MIN(stripe_ofs + rule.stripe_max_size, part_ofs + rule.part_size);
+    stripe_size = next - stripe_ofs;
   }
 
   update_location();