Merge pull request #1599 from ceph/wip-7978

rgw: only look at next placement rule if we're not at the last rule

Reviewed-by: Sage Weil <sage@inktank.com>
This commit is contained in:
Sage Weil 2014-04-03 17:44:13 -07:00
commit 80a1ed8a74

View File

@ -680,10 +680,11 @@ void RGWObjManifest::obj_iterator::operator++()
part_ofs += rule->part_size;
stripe_ofs = part_ofs;
bool last_rule = (next_rule_iter == manifest->rules.end());
/* move to the next rule? */
if (stripe_ofs >= next_rule_iter->second.start_ofs) {
if (!last_rule && stripe_ofs >= next_rule_iter->second.start_ofs) {
rule_iter = next_rule_iter;
bool last_rule = (next_rule_iter == manifest->rules.end());
last_rule = (next_rule_iter == manifest->rules.end());
if (!last_rule) {
++next_rule_iter;
}