]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix wrong handling of limit=0 during listing of Swift account. 7821/head
authorRadoslaw Zarzynski <rzarzynski@mirantis.com>
Fri, 26 Feb 2016 15:42:01 +0000 (16:42 +0100)
committerRadoslaw Zarzynski <rzarzynski@mirantis.com>
Fri, 26 Feb 2016 20:18:11 +0000 (21:18 +0100)
Fixes: #14903
Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
src/rgw/rgw_op.cc
src/rgw/rgw_op.h
src/rgw/rgw_rest_swift.h

index b4171217c887e29555d2c8fda16720a55f75806f..bd9dfbc59d5126867c07be5b640294334ecaa320 100644 (file)
@@ -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 */
index 895c2b3991e4fa0694e35ee8d79df96818418bff..482ebe2b801a319b04a98c2da3fe93402eee71b2 100644 (file)
@@ -286,6 +286,10 @@ protected:
   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;
index 170f4fe78ba5040917cdac309999cd98a646005c..1ed1f597e37f5aad3f0eadc74e94ba537265b07f 100644 (file)
@@ -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() {}