From: Samuel Just Date: Tue, 18 Oct 2016 21:46:53 +0000 (-0700) Subject: ReplicatedPG::OpContext::start_async_reads: tolerate case sync callback call X-Git-Tag: v11.1.0~245^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b237321bdafff2e3c7ba47f3a96d400f3cc7a040;p=ceph.git ReplicatedPG::OpContext::start_async_reads: tolerate case sync callback call If the read can be completed immediately, objects_read_async will call the callback syncronously, which will result in ctx being cleaned up. Clear pending_async_reads before the call. Signed-off-by: Samuel Just --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index a3d324938832..4e01744519cc 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -246,11 +246,13 @@ class ReplicatedPG::C_OSD_AppliedRecoveredObjectReplica : public Context { void ReplicatedPG::OpContext::start_async_reads(ReplicatedPG *pg) { inflightreads = 1; + list, + pair > > in; + in.swap(pending_async_reads); pg->pgbackend->objects_read_async( obc->obs.oi.soid, - pending_async_reads, + in, new OnReadComplete(pg, this), pg->get_pool().fast_read); - pending_async_reads.clear(); } void ReplicatedPG::OpContext::finish_read(ReplicatedPG *pg) {