]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: move forward marker even in case of many non-existent indexes 32513/head
authorIlsoo Byun <ilsoobyun@linecorp.com>
Tue, 7 Jan 2020 01:35:53 +0000 (10:35 +0900)
committerIlsoo Byun <ilsoobyun@linecorp.com>
Tue, 7 Jan 2020 01:35:53 +0000 (10:35 +0900)
Signed-off-by: Ilsoo Byun <ilsoobyun@linecorp.com>
src/rgw/rgw_rados.cc

index b3e1d824f40de4a53df060ca67fefbb5b77555ad..ab3baee3b5f99a5a6d9610c5738e33c274e4af24 100644 (file)
@@ -8091,10 +8091,11 @@ int RGWRados::cls_bucket_list_ordered(RGWBucketInfo& bucket_info,
 
   map<string, bufferlist> updates;
   uint32_t count = 0;
+  int pos = -1;
   while (count < num_entries && !candidates.empty()) {
     r = 0;
     // select the next one
-    int pos = candidates.begin()->second;
+    pos = candidates.begin()->second;
     const string& name = vcurrents[pos]->first;
     struct rgw_bucket_dir_entry& dirent = vcurrents[pos]->second;
 
@@ -8164,9 +8165,8 @@ int RGWRados::cls_bucket_list_ordered(RGWBucketInfo& bucket_info,
       count << ", which is truncated" << dendl;
   }
 
-  if (!m.empty()) {
-    *last_entry = m.rbegin()->first;
-  }
+  if (pos >= 0)
+    *last_entry = std::move((--vcurrents[pos])->first);
 
   return 0;
 }