]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
osd: fix the mem leak of RepGather 10423/head
authorKefu Chai <kchai@redhat.com>
Mon, 25 Jul 2016 03:12:14 +0000 (11:12 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 25 Jul 2016 08:29:41 +0000 (16:29 +0800)
commitd3a28465fc7b7002f38cff364fdf601f7486add3
treeb8290f127efd2007c3e708dbcdc7e6393b26c864
parent16ce830ce7b91b987263986afd1e82149d182776
osd: fix the mem leak of RepGather

ReplicatedPG::new_repop() returns a pointer to RepGather with two refcounts,
one is held by ReplicatedPG::repop_queue, the other is supposed to be
held by the caller of this function. but it's caller
ReplicatedPG::submit_log_entries() assigns it to a
boost::intrusive_ptr<RepGather>() directly, why by default add_ref() in
its constructor. this makes the refcount 3. that's why we have a leak of
RepGather in `ReplicatedPG::new_repop(ObcLockManager&&,
boost::optional<std::function<void ()>>&&)`.

Fixes: http://tracker.ceph.com/issues/16801
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/osd/ReplicatedPG.cc
src/osd/ReplicatedPG.h