]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: fix offset calculation in copy_obj_data
authorSeena Fallah <seenafallah@gmail.com>
Tue, 25 Nov 2025 18:22:44 +0000 (19:22 +0100)
committerSeena Fallah <seenafallah@gmail.com>
Tue, 25 Nov 2025 18:22:49 +0000 (19:22 +0100)
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 <seenafallah@gmail.com>
src/rgw/driver/rados/rgw_rados.cc

index c1e49706213952bdeb45b64090a8c3a95786a5b2..21709b08c73897c9efb47e979987dba3319b28ab 100644 (file)
@@ -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();