Skip to content

Commit

Permalink
Merge pull request ceph#7821 from rzarzynski/wip-rgw-14903
Browse files Browse the repository at this point in the history
rgw: fix wrong handling of limit=0 during listing of Swift account.

Reviewed-by: Yehuda Sadeh <[email protected]>
  • Loading branch information
yehudasa committed Feb 26, 2016
2 parents d7b47c2 + ec186f4 commit 8880211
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/rgw/rgw_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1307,8 +1307,9 @@ void RGWListBuckets::execute()
}

op_ret = rgw_read_user_buckets(store, s->user->user_id, buckets,
marker, end_marker, read_count,
should_get_stats(), &is_truncated);
marker, end_marker, read_count,
should_get_stats(), &is_truncated,
get_default_max());
if (op_ret < 0) {
/* hmm.. something wrong here.. the user was authenticated, so it
should exist */
Expand Down
4 changes: 4 additions & 0 deletions src/rgw/rgw_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,10 @@ class RGWListBuckets : public RGWOp {
map<string, bufferlist> attrs;
bool is_truncated;

virtual uint64_t get_default_max() const {
return 1000;
}

public:
RGWListBuckets() : sent_data(false) {
limit = limit_max = RGW_LIST_BUCKETS_LIMIT_MAX;
Expand Down
4 changes: 4 additions & 0 deletions src/rgw/rgw_rest_swift.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ class RGWGetObj_ObjStore_SWIFT : public RGWGetObj_ObjStore {

class RGWListBuckets_ObjStore_SWIFT : public RGWListBuckets_ObjStore {
bool need_stats;

uint64_t get_default_max() const override {
return 0;
}
public:
RGWListBuckets_ObjStore_SWIFT() : need_stats(true) {}
~RGWListBuckets_ObjStore_SWIFT() {}
Expand Down

0 comments on commit 8880211

Please sign in to comment.