mirror of
https://github.com/ceph/ceph
synced 2025-01-02 09:02:34 +00:00
rgw: fix use of marker in List::list_objects()
Fixes: http://tracker.ceph.com/issues/18331 List marker is an index key, so treat it as such. This fixes infinite loop in orphans find command. Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
This commit is contained in:
parent
fc9a03ec4f
commit
a5d1fa0587
@ -5122,21 +5122,20 @@ int RGWRados::Bucket::List::list_objects(int max, vector<RGWObjEnt> *result,
|
|||||||
|
|
||||||
result->clear();
|
result->clear();
|
||||||
|
|
||||||
rgw_obj marker_obj, end_marker_obj, prefix_obj;
|
rgw_bucket b;
|
||||||
marker_obj.set_instance(params.marker.instance);
|
rgw_obj marker_obj(b, params.marker);
|
||||||
marker_obj.set_ns(params.ns);
|
rgw_obj end_marker_obj(b, params.end_marker);
|
||||||
marker_obj.set_obj(params.marker.name);
|
rgw_obj prefix_obj;
|
||||||
|
rgw_obj_key cur_end_marker;
|
||||||
|
if (!params.ns.empty()) {
|
||||||
|
marker_obj.set_ns(params.ns);
|
||||||
|
end_marker_obj.set_ns(params.ns);
|
||||||
|
end_marker_obj.get_index_key(&cur_end_marker);
|
||||||
|
}
|
||||||
rgw_obj_key cur_marker;
|
rgw_obj_key cur_marker;
|
||||||
marker_obj.get_index_key(&cur_marker);
|
marker_obj.get_index_key(&cur_marker);
|
||||||
|
|
||||||
end_marker_obj.set_instance(params.end_marker.instance);
|
const bool cur_end_marker_valid = !params.end_marker.empty();
|
||||||
end_marker_obj.set_ns(params.ns);
|
|
||||||
end_marker_obj.set_obj(params.end_marker.name);
|
|
||||||
rgw_obj_key cur_end_marker;
|
|
||||||
if (params.ns.empty()) { /* no support for end marker for namespaced objects */
|
|
||||||
end_marker_obj.get_index_key(&cur_end_marker);
|
|
||||||
}
|
|
||||||
const bool cur_end_marker_valid = !cur_end_marker.empty();
|
|
||||||
|
|
||||||
prefix_obj.set_ns(params.ns);
|
prefix_obj.set_ns(params.ns);
|
||||||
prefix_obj.set_obj(params.prefix);
|
prefix_obj.set_obj(params.prefix);
|
||||||
@ -5212,8 +5211,8 @@ int RGWRados::Bucket::List::list_objects(int max, vector<RGWObjEnt> *result,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (count < max) {
|
if (count < max) {
|
||||||
params.marker = obj;
|
params.marker = key;
|
||||||
next_marker = obj;
|
next_marker = key;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (params.filter && !params.filter->filter(obj.name, key.name))
|
if (params.filter && !params.filter->filter(obj.name, key.name))
|
||||||
|
Loading…
Reference in New Issue
Block a user