]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ReplicatedPG: agent_work() fix next if finished early due to start_max
authorDavid Zafman <david.zafman@inktank.com>
Fri, 2 May 2014 01:54:30 +0000 (18:54 -0700)
committerDavid Zafman <david.zafman@inktank.com>
Fri, 2 May 2014 02:21:01 +0000 (19:21 -0700)
Backport: firefly

Signed-off-by: David Zafman <david.zafman@inktank.com>
src/osd/ReplicatedPG.cc

index 9a4f12fab763994f8674dda4d5cb894675ac447c..44bb805cf7685fecd293d02a36043da7798eaea4 100644 (file)
@@ -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) {