From 9cf470cac8dd4d8f769e768f2de6b9eb67a3c3af Mon Sep 17 00:00:00 2001 From: David Zafman Date: Thu, 1 May 2014 18:54:30 -0700 Subject: [PATCH] osd/ReplicatedPG: agent_work() fix next if finished early due to start_max Backport: firefly Signed-off-by: David Zafman --- src/osd/ReplicatedPG.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 9a4f12fab7639..44bb805cf7685 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) { -- 2.39.5