From: Yehuda Sadeh Date: Thu, 3 Apr 2014 22:15:41 +0000 (-0700) Subject: rgw: only look at next placement rule if we're not at the last rule X-Git-Tag: v0.79~14^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0552ecbabb3576fc39823bb3f6830353ac55bedc;p=ceph.git rgw: only look at next placement rule if we're not at the last rule Fixes: #7978 We tried to move to the next placement rule, but we were already at the last one, so we ended up looping forever. Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 9da467f5d8ec..405f00f1f004 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -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; }