]> 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:12:13 +0000 (17:12 +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
- nautilus lacks "unsigned" in the line "unsigned char e = delim.back();"

src/rgw/rgw_rados.cc

index 4441ff0f577f09fc7b1495b8adda4807240cb19e..ff7e5ac094280a3454b522e91bf1c12759800ad9 100644 (file)
@@ -2436,15 +2436,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;
 }