]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
return parts_count from read_op::prepare whenever applicable
authorMatt Benjamin <mbenjamin@redhat.com>
Sat, 27 Apr 2024 14:24:25 +0000 (10:24 -0400)
committerMatt Benjamin <mbenjamin@redhat.com>
Wed, 3 Jul 2024 18:38:59 +0000 (14:38 -0400)
* fix to deal with parts_count == 1 asymmetry

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
src/rgw/driver/rados/rgw_rados.cc

index 088435d857382395b9c4d74c353fdb9aa1c6d846..f394a3e6ec0ba4822856785571eb1f31ce51320b 100644 (file)
@@ -6747,6 +6747,12 @@ int RGWRados::Object::Read::prepare(optional_yield y, const DoutPrefixProvider *
   if (r < 0)
     return r;
 
+  if (manifest /* params.parts_count */) {
+      RGWObjManifest::obj_iterator end = manifest->obj_end(dpp);
+      auto cur_part_id = end.get_cur_part_id();
+      params.parts_count = (cur_part_id == 1) ? 1 : cur_part_id - 1;;
+  }
+
   if (!astate->exists) {
     return -ENOENT;
   }