]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
radosgw-admin: Pass max_entries for bucket list 65486/head
authorTobias Urdin <tobias.urdin@binero.com>
Thu, 24 Jul 2025 21:42:46 +0000 (23:42 +0200)
committerTobias Urdin <tobias.urdin@binero.com>
Thu, 11 Sep 2025 13:42:14 +0000 (15:42 +0200)
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 <tobias.urdin@binero.com>
(cherry picked from commit 3909c6554cdfcf1b05b5e32297b2e65e9c67af2b)

src/rgw/rgw_admin.cc

index b6757fed944c76dd7793d4bdbf4c5fbe931f3697..a2727bba167942921fb3203b800d39b68562d11c 100644 (file)
@@ -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) {