]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: GetObjAttrs enforces MaxSize and returns correct IsTruncated
authorCasey Bodley <cbodley@redhat.com>
Fri, 18 Oct 2024 17:46:38 +0000 (13:46 -0400)
committerMatt Benjamin <mbenjamin@redhat.com>
Wed, 8 Jan 2025 00:17:42 +0000 (19:17 -0500)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/driver/rados/rgw_sal_rados.cc
src/rgw/rgw_op.h

index 49ad4bb3bb21747f49bdadf385b9382662fbb25e..24f44c94f37935ff05631cdd293013ebb6938dd9 100644 (file)
@@ -2527,6 +2527,11 @@ int RadosObject::list_parts(const DoutPrefixProvider* dpp, CephContext* cct,
       continue;
     }
 
+    if (max_parts < 1) {
+      *truncated = true;
+      break;
+    }
+
     /* get_part_obj_state alters the passed manifest** to point to a part
      * manifest, which we don't want to leak out here */
     RGWObjManifest* obj_m = manifest;
@@ -2563,6 +2568,7 @@ int RadosObject::list_parts(const DoutPrefixProvider* dpp, CephContext* cct,
 
     each_func(obj_part);
     *next_marker = ++marker;
+    --max_parts;
   } /* each part */
   
   return ret;
index dfc2b914b5b56658b4ea043265a85753b86156c9..d3980bc718315c904460db0325e689abda0d4cee 100644 (file)
@@ -1651,7 +1651,7 @@ protected:
   std::string version_id;
   std::string expected_bucket_owner;
   int marker{0};
-  int max_parts{0};
+  int max_parts{1000};
   uint16_t requested_attributes{0};
 #if 0
   /* used to decrypt attributes for objects stored with SSE-C */