From: Tobias Urdin Date: Thu, 24 Jul 2025 21:42:46 +0000 (+0200) Subject: radosgw-admin: Pass max_entries for bucket list X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=39e7715f5419aad5eeab266701aac0195fd0e16a;p=ceph.git radosgw-admin: Pass max_entries for bucket list The changes in [1] did not take into account that radosgw-admin code calls `RGWBucketAdminOp::info` directly and passes a `RGWBucketAdminOpState` struct where max_entries is not initialized so we should not assume that it's zero. This in turn broke the `bucket list --uid foo` and `bucket stats --uid foo` commands as the output was changed and thus not keeping backward compatibility. This change makes sure that we populate max_entries in `RGWBucketAdminOpState` if `--max-entries` argument was specified otherwise we set it to zero to keep the backward compatibility in the output format. [1] https://github.com/ceph/ceph/pull/62777 Fixes: https://tracker.ceph.com/issues/72049 Signed-off-by: Tobias Urdin (cherry picked from commit 3909c6554cdfcf1b05b5e32297b2e65e9c67af2b) --- diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index b6757fed944c7..a2727bba16794 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -7279,6 +7279,10 @@ int main(int argc, const char **argv) } } bucket_op.marker = marker; + if (max_entries_specified) + bucket_op.max_entries = max_entries; + else + bucket_op.max_entries = 0; /* for backward compatibility */ RGWBucketAdminOp::info(driver, bucket_op, stream_flusher, null_yield, dpp()); } else { int ret = init_bucket(tenant, bucket_name, bucket_id, &bucket); @@ -7396,6 +7400,10 @@ int main(int argc, const char **argv) bucket_op.set_bucket_name(bucket.name); } bucket_op.set_fetch_stats(true); + if (max_entries_specified) + bucket_op.max_entries = max_entries; + else + bucket_op.max_entries = 0; /* for backward compatibility */ int r = RGWBucketAdminOp::info(driver, bucket_op, stream_flusher, null_yield, dpp()); if (r < 0) {