From: Giovani Rinaldi Date: Wed, 5 Apr 2017 19:46:14 +0000 (-0300) Subject: rgw: fix listing of objects that start with underscore X-Git-Tag: v12.1.1~128^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c1a1539af596e97dc412a505d5411ee6cfdd3980;p=ceph.git rgw: fix listing of objects that start with underscore Current marker and prefix search utilized in rgw's function list_objects should respect index key name in order to correctly list objects which have names starting with underscore. Fixes: http://tracker.ceph.com/issues/19432 Signed-off-by: Giovani Rinaldi --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 88b2710c6ef..fcea5a13de2 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -5547,7 +5547,7 @@ int RGWRados::Bucket::List::list_objects(int max, vector * bigger_than_delim = buf; /* if marker points at a common prefix, fast forward it into its upperbound string */ - int delim_pos = cur_marker.name.find(params.delim, params.prefix.size()); + int delim_pos = cur_marker.name.find(params.delim, cur_prefix.size()); if (delim_pos >= 0) { string s = cur_marker.name.substr(0, delim_pos); s.append(bigger_than_delim); @@ -5628,10 +5628,12 @@ int RGWRados::Bucket::List::list_objects(int max, vector * truncated = true; goto done; } - next_marker = prefix_key; (*common_prefixes)[prefix_key] = true; - skip_after_delim = obj.name.substr(0, delim_pos); + int marker_delim_pos = cur_marker.name.find(params.delim, cur_prefix.size()); + next_marker = cur_marker.name.substr(0, marker_delim_pos + 1); + + skip_after_delim = cur_marker.name.substr(0, marker_delim_pos); skip_after_delim.append(bigger_than_delim); ldout(cct, 20) << "skip_after_delim=" << skip_after_delim << dendl;