]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix setting of namespace in ordered and unordered bucket listing 37673/head
authorJ. Eric Ivancich <ivancich@redhat.com>
Tue, 6 Oct 2020 16:42:22 +0000 (12:42 -0400)
committerVicente Cheng <freeze.bilsted@gmail.com>
Thu, 15 Oct 2020 08:44:39 +0000 (08:44 +0000)
The namespace is not always set correctly during bucket listing. This
can, for example, cause the listing of incomplete multipart uploads,
which are in the _multipart_ namespace, to not paginate correctly, and
cause entries to be re-listed.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
(cherry picked from commit bd6f163f366753e8ec42b85a53334f4bf78916bd)

src/rgw/rgw_rados.cc

index 71e639927563cb8533c044c252d38c7550ab051b..2d74d5af48383e6c04a2f3d1bf4c76f674c6685f 100644 (file)
@@ -1766,13 +1766,13 @@ int RGWRados::Bucket::List::list_objects_ordered(
   // or it will be empty; either way it's OK to copy
   rgw_obj_key marker_obj(params.marker.name,
                         params.marker.instance,
-                        params.marker.ns);
+                        params.ns.empty() ? params.marker.ns : params.ns);
   rgw_obj_index_key cur_marker;
   marker_obj.get_index_key(&cur_marker);
 
   rgw_obj_key end_marker_obj(params.end_marker.name,
                             params.end_marker.instance,
-                            params.end_marker.ns);
+                            params.ns.empty() ? params.end_marker.ns : params.ns);
   rgw_obj_index_key cur_end_marker;
   end_marker_obj.get_index_key(&cur_end_marker);
   const bool cur_end_marker_valid = !params.end_marker.empty();
@@ -2051,13 +2051,13 @@ int RGWRados::Bucket::List::list_objects_unordered(int64_t max_p,
   // or it will be empty; either way it's OK to copy
   rgw_obj_key marker_obj(params.marker.name,
                         params.marker.instance,
-                        params.marker.ns);
+                        params.ns.empty() ? params.marker.ns : params.ns);
   rgw_obj_index_key cur_marker;
   marker_obj.get_index_key(&cur_marker);
 
   rgw_obj_key end_marker_obj(params.end_marker.name,
                             params.end_marker.instance,
-                            params.end_marker.ns);
+                            params.ns.empty() ? params.end_marker.ns : params.ns);
   rgw_obj_index_key cur_end_marker;
   end_marker_obj.get_index_key(&cur_end_marker);
   const bool cur_end_marker_valid = !params.end_marker.empty();