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=3909c6554cdfcf1b05b5e32297b2e65e9c67af2b;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 --- diff --git a/src/rgw/radosgw-admin/radosgw-admin.cc b/src/rgw/radosgw-admin/radosgw-admin.cc index 2a79d9d421ef..aa1ef218c583 100644 --- a/src/rgw/radosgw-admin/radosgw-admin.cc +++ b/src/rgw/radosgw-admin/radosgw-admin.cc @@ -7539,6 +7539,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); @@ -7656,6 +7660,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) {