From 9968b938b5d47fdf3a67db134bd2ea6bf3a28086 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Tue, 6 May 2014 16:55:27 -0700 Subject: [PATCH] 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 --- src/rgw/rgw_rados.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 0ea7057f5bd58..0c1f7cba26437 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(); -- 2.39.5