]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix minimum of unordered bucket listing 30666/head
authorJ. Eric Ivancich <ivancich@redhat.com>
Wed, 4 Sep 2019 14:02:32 +0000 (10:02 -0400)
committerNathan Cutler <ncutler@suse.com>
Tue, 1 Oct 2019 15:09:39 +0000 (17:09 +0200)
A recent PR made sure that a bucket listing could not request too many
entries at once. It also did a minimum computation for number of
entries. For ordered listing the minimum was 0, as required to pass
all unit tests. However the minimum for unordered listing was left at
1. In order to make ordered and unordered listing behave the same --
with the exception of ordering -- the minimum for unordered listing is
modified to 0.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
(cherry picked from commit 38e02a7157d4c534cc9fd8ccfe20fdd93a9b07a8)

src/rgw/rgw_rados.cc

index b0d34d7ef0e1feecc9f7b68d5124c793f7cb8f38..e81d3bf6280e1d9ae5bb7c55cb2027315b9fac13 100644 (file)
@@ -5645,7 +5645,7 @@ int RGWRados::Bucket::List::list_objects_ordered(int64_t max_p,
 
   int count = 0;
   bool truncated = true;
-  const int64_t max = // protect against memory issues and non-positive vals
+  const int64_t max = // protect against memory issues and negative vals
     std::min(bucket_list_objects_absolute_max, std::max(int64_t(0), max_p));
   int read_ahead = std::max(cct->_conf->rgw_list_bucket_min_readahead, max);
 
@@ -5836,8 +5836,8 @@ int RGWRados::Bucket::List::list_objects_unordered(int64_t max_p,
   int count = 0;
   bool truncated = true;
 
-  const int64_t max = // protect against memory issues and non-positive vals
-    std::min(bucket_list_objects_absolute_max, std::max(int64_t(1), max_p));
+  const int64_t max = // protect against memory issues and negative vals
+    std::min(bucket_list_objects_absolute_max, std::max(int64_t(0), max_p));
 
   // read a few extra in each call to cls_bucket_list_unordered in
   // case some are filtered out due to namespace matching, versioning,