From: Casey Bodley Date: Mon, 4 Dec 2023 21:34:12 +0000 (-0500) Subject: rgw/rados: rgw_list_pool() loops until 'max' matches X-Git-Tag: v19.3.0~387^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F54748%2Fhead;p=ceph.git rgw/rados: rgw_list_pool() loops until 'max' matches instead of looping up to 'max' oids, continue looping until the filter actually matches 'max' entries Signed-off-by: Casey Bodley --- diff --git a/src/rgw/driver/rados/rgw_tools.cc b/src/rgw/driver/rados/rgw_tools.cc index bf78b9bb22e2..269c790e401e 100644 --- a/src/rgw/driver/rados/rgw_tools.cc +++ b/src/rgw/driver/rados/rgw_tools.cc @@ -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;