This could otherwise result in an assertion failure in the API if
it failed to retrieve the status on an image and therefore required
a second iteration through the loop.
Fixes: https://tracker.ceph.com/issues/48522
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
mirror_image_info_t info;
r = image_get_info(io_ctx, asio_engine.get_work_queue(), image_id, &info);
- if (r >= 0) {
- (*entries)[image_id] = std::make_pair(mode, info);
+ if (r < 0) {
+ continue;
+ }
+
+ (*entries)[image_id] = std::make_pair(mode, info);
+ if (entries->size() == max) {
+ break;
}
}