From: Yehuda Sadeh Date: Tue, 6 May 2014 23:55:27 +0000 (-0700) Subject: rgw: fix stripe_size calculation X-Git-Tag: v0.81~49^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9968b938b5d47fdf3a67db134bd2ea6bf3a28086;p=ceph.git rgw: fix stripe_size calculation 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 --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 0ea7057f5bd5..0c1f7cba2643 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -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();