]> 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 32824/head
authorIlsoo Byun <ilsoobyun@linecorp.com>
Tue, 7 Jan 2020 01:35:53 +0000 (10:35 +0900)
committerNathan Cutler <ncutler@suse.com>
Fri, 24 Jan 2020 14:53:40 +0000 (15:53 +0100)
Signed-off-by: Ilsoo Byun <ilsoobyun@linecorp.com>
(cherry picked from commit 2eaac132d491ef3c6f8cb50c34fc67f56e006c07)

Conflicts:
src/rgw/rgw_rados.cc
- comment is slightly different in nautilus
- nautilus does not have "if (*is_truncated && count < num_entries)"
  conditional block

src/rgw/rgw_rados.cc

index 095af8d5cf4c30b99c8606b02dc36fa9032a89d4..cf590e5bee87075b850f293c97b376218a6f39ad 100644 (file)
@@ -9145,10 +9145,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;
 
@@ -9204,8 +9205,9 @@ int RGWRados::cls_bucket_list_ordered(RGWBucketInfo& bucket_info,
       break;
     }
   }
-  if (!m.empty())
-    *last_entry = m.rbegin()->first;
+
+  if (pos >= 0)
+    *last_entry = std::move((--vcurrents[pos])->first);
 
   return 0;
 }