From 5b798a3d47f1a98bac10e82997704c83bd7eec35 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 30 Sep 2010 22:00:06 -0700 Subject: [PATCH] osd: fix recovery_primary loop on local clone When we take the clone branch, we update the missing map. This invalidates our current iterator, which can cause badness. Instead, increment the iterator near the top of the loop so we don't have to worry about it. Signed-off-by: Sage Weil --- src/osd/ReplicatedPG.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 36d46e22772ec..f9b4da63570d9 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -3878,6 +3878,7 @@ int ReplicatedPG::recover_primary(int max) soid = p->second; } Missing::item& item = missing.missing[p->second]; + p++; sobject_t head = soid; head.snap = CEPH_NOSNAP; @@ -3932,8 +3933,6 @@ int ReplicatedPG::recover_primary(int max) } } - p++; - // only advance last_requested if we haven't skipped anything if (!skipped) log.last_requested = v; -- 2.39.5