From: David Zafman Date: Fri, 2 May 2014 01:54:30 +0000 (-0700) Subject: osd/ReplicatedPG: agent_work() fix next if finished early due to start_max X-Git-Tag: v0.81~78^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9cf470cac8dd4d8f769e768f2de6b9eb67a3c3af;p=ceph.git osd/ReplicatedPG: agent_work() fix next if finished early due to start_max Backport: firefly Signed-off-by: David Zafman --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 9a4f12fab76..44bb805cf76 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -11048,8 +11048,12 @@ void ReplicatedPG::agent_work(int start_max) if (agent_state->evict_mode != TierAgentState::EVICT_MODE_IDLE && agent_maybe_evict(obc)) ++started; - if (started >= start_max) + if (started >= start_max) { + // If finishing early, set "next" to the next object + if (++p != ls.end()) + next = *p; break; + } } if (++agent_state->hist_age > g_conf->osd_agent_hist_halflife) {