]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix list bucket with start maker and delimiter '/' will miss next object with...
authorTianshan Qu <tianshan@xsky.com>
Tue, 21 May 2019 10:50:06 +0000 (18:50 +0800)
committerNathan Cutler <ncutler@suse.com>
Fri, 12 Jul 2019 15:01:42 +0000 (17:01 +0200)
'/' + 1 = '0', and the start marker will be skipped, so it will miss the
'0' object.

Fixes: http://tracker.ceph.com/issues/39989
Signed-off-by: Tianshan Qu <tianshan@xsky.com>
(cherry picked from commit 43b5264c7d61ae3be56d68f131b544edee307a46)

Conflicts:
src/rgw/rgw_rados.cc
- mimic does not have "unsigned" in the line "unsigned char e = delim.back();"

src/rgw/rgw_rados.cc

index 40783cf449e05b012b1541dbf3b322ba44a67439..cb68d60171c6ba7815cfaeecfdbe559e4c6cbfa1 100644 (file)
@@ -5638,15 +5638,8 @@ int RGWRados::Bucket::update_bucket_id(const string& new_bucket_id)
 static inline std::string after_delim(std::string_view delim)
 {
   // assert: ! delim.empty()
-  char e = delim.back();
-  delim.remove_suffix(1);
   std::string result{delim.data(), delim.length()};
-  if (e < 255) {
-    result += char(++e);
-  } else {
-    result += e;
-    result += char(255);
-  }
+  result += char(255);
   return result;
 }