Skip to content

Commit 862104b

Browse files
authored
Merge pull request ceph#60674 from oshrey16/bugfix-rgw-ps-list-topics-op
rgw/notification: Fix segmentation fault in RGWPSListTopicsOp::execute() and correct topic listing to use get_topics_v2 Reviewed-By: Joseph Mundackal <[email protected]>, Yuval Lifshitz <[email protected]>
2 parents cc843c2 + d27dab2 commit 862104b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/rgw/rgw_rest_pubsub.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -494,11 +494,11 @@ void RGWPSListTopicsOp::execute(optional_yield y) {
494494

495495
const RGWPubSub ps(driver, get_account_or_tenant(s->owner.id), *s->penv.site);
496496
if (rgw::all_zonegroups_support(*s->penv.site, rgw::zone_features::notification_v2) &&
497-
driver->stat_topics_v1(s->bucket->get_tenant(), null_yield, this) == -ENOENT) {
498-
op_ret = ps.get_topics_v1(this, result, y);
499-
} else {
497+
driver->stat_topics_v1(get_account_or_tenant(s->owner.id), null_yield, this) == -ENOENT) {
500498
constexpr int max_items = 100;
501499
op_ret = ps.get_topics_v2(this, start_token, max_items, result, next_token, y);
500+
} else {
501+
op_ret = ps.get_topics_v1(this, result, y);
502502
}
503503
// if there are no topics it is not considered an error
504504
op_ret = op_ret == -ENOENT ? 0 : op_ret;

0 commit comments

Comments
 (0)