From: Radoslaw Zarzynski Date: Fri, 26 Feb 2016 15:42:01 +0000 (+0100) Subject: rgw: fix wrong handling of limit=0 during listing of Swift account. X-Git-Tag: v10.1.0~287^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F7821%2Fhead;p=ceph.git rgw: fix wrong handling of limit=0 during listing of Swift account. Fixes: #14903 Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index b4171217c88..bd9dfbc59d5 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -1310,8 +1310,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 */ diff --git a/src/rgw/rgw_op.h b/src/rgw/rgw_op.h index 895c2b3991e..482ebe2b801 100644 --- a/src/rgw/rgw_op.h +++ b/src/rgw/rgw_op.h @@ -286,6 +286,10 @@ protected: map 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; diff --git a/src/rgw/rgw_rest_swift.h b/src/rgw/rgw_rest_swift.h index 170f4fe78ba..1ed1f597e37 100644 --- a/src/rgw/rgw_rest_swift.h +++ b/src/rgw/rgw_rest_swift.h @@ -21,6 +21,10 @@ public: 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() {}