Merge pull request #13147 from yehudasa/wip-18331

rgw: fix use of marker in List::list_objects()
This commit is contained in:
Matt Benjamin 2017-02-03 11:57:23 -05:00 committed by GitHub
commit 5bf39156d8

View File

@ -5124,21 +5124,20 @@ int RGWRados::Bucket::List::list_objects(int max, vector<RGWObjEnt> *result,
result->clear();
rgw_obj marker_obj, end_marker_obj, prefix_obj;
marker_obj.set_instance(params.marker.instance);
marker_obj.set_ns(params.ns);
marker_obj.set_obj(params.marker.name);
rgw_bucket b;
rgw_obj marker_obj(b, params.marker);
rgw_obj end_marker_obj(b, params.end_marker);
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;
marker_obj.get_index_key(&cur_marker);
end_marker_obj.set_instance(params.end_marker.instance);
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();
const bool cur_end_marker_valid = !params.end_marker.empty();
prefix_obj.set_ns(params.ns);
prefix_obj.set_obj(params.prefix);
@ -5214,8 +5213,8 @@ int RGWRados::Bucket::List::list_objects(int max, vector<RGWObjEnt> *result,
}
if (count < max) {
params.marker = obj;
next_marker = obj;
params.marker = key;
next_marker = key;
}
if (params.filter && !params.filter->filter(obj.name, key.name))