]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: only look at next placement rule if we're not at the last rule 1599/head
authorYehuda Sadeh <yehuda@inktank.com>
Thu, 3 Apr 2014 22:15:41 +0000 (15:15 -0700)
committerYehuda Sadeh <yehuda@inktank.com>
Thu, 3 Apr 2014 22:15:41 +0000 (15:15 -0700)
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 <yehuda@inktank.com>
src/rgw/rgw_rados.cc

index 9da467f5d8ec93895a942b575ce3d789a948db37..405f00f1f004484a02a2e3a967cedccefc6f20b5 100644 (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;
         }