diff options
author | Yehuda Sadeh <yehuda@inktank.com> | 2014-04-04 00:15:41 +0200 |
---|---|---|
committer | Yehuda Sadeh <yehuda@inktank.com> | 2014-04-04 00:15:41 +0200 |
commit | 0552ecbabb3576fc39823bb3f6830353ac55bedc (patch) | |
tree | 7c5a51b8f851d973a75673ffd3aff69310817ad2 | |
parent | Merge pull request #1598 from ceph/wip-test-alloc-hint-ec-fix (diff) | |
download | ceph-0552ecbabb3576fc39823bb3f6830353ac55bedc.tar.xz ceph-0552ecbabb3576fc39823bb3f6830353ac55bedc.zip |
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 <yehuda@inktank.com>
-rw-r--r-- | src/rgw/rgw_rados.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 9da467f5d8e..405f00f1f00 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; } |