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 <sage@newdream.net>
This commit is contained in:
Sage Weil 2010-09-30 22:00:06 -07:00
parent 569d96bb80
commit 5b798a3d47

View File

@ -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;