From: Seena Fallah Date: Tue, 25 Nov 2025 18:22:44 +0000 (+0100) Subject: rgw: fix offset calculation in copy_obj_data X-Git-Tag: testing/wip-vshankar-testing-20260219.051425~1^2~4^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=16e477d2099044c4df5114877e18abb9d0172b8b;p=ceph-ci.git rgw: fix offset calculation in copy_obj_data Set ofs to total bytes read by adding 1 to end offset. Since 'end' represents the last byte offset (zero-indexed), we need to add 1 to get the actual number of bytes copied. Signed-off-by: Seena Fallah --- diff --git a/src/rgw/driver/rados/rgw_rados.cc b/src/rgw/driver/rados/rgw_rados.cc index c1e49706213..21709b08c73 100644 --- a/src/rgw/driver/rados/rgw_rados.cc +++ b/src/rgw/driver/rados/rgw_rados.cc @@ -5372,7 +5372,9 @@ int RGWRados::copy_obj_data(RGWObjectCtx& obj_ctx, return ret; } - ofs = end; + // set ofs to the total bytes read + // `end` is always the last byte offset, so add 1 + ofs = end + 1; // flush ret = filter->flush();