]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/rados: rgw_list_pool() loops until 'max' matches 54748/head
authorCasey Bodley <cbodley@redhat.com>
Mon, 4 Dec 2023 21:34:12 +0000 (16:34 -0500)
committerCasey Bodley <cbodley@redhat.com>
Mon, 4 Dec 2023 21:34:13 +0000 (16:34 -0500)
instead of looping up to 'max' oids, continue looping until the filter
actually matches 'max' entries

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/driver/rados/rgw_tools.cc

index bf78b9bb22e2427918a69d1e01c9a1551860713e..269c790e401e29a594e277e042bdc5affd80c9c3 100644 (file)
@@ -517,9 +517,7 @@ int rgw_list_pool(const DoutPrefixProvider *dpp,
   if (iter == ioctx.nobjects_end())
     return -ENOENT;
 
-  uint32_t i;
-
-  for (i = 0; i < max && iter != ioctx.nobjects_end(); ++i, ++iter) {
+  for (; oids->size() < max && iter != ioctx.nobjects_end(); ++iter) {
     string oid = iter->get_oid();
     ldpp_dout(dpp, 20) << "RGWRados::pool_iterate: got " << oid << dendl;