]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
osd: fix the mem leak of RepGather 10760/head
authorKefu Chai <kchai@redhat.com>
Mon, 25 Jul 2016 03:12:14 +0000 (11:12 +0800)
committerLoic Dachary <ldachary@redhat.com>
Wed, 17 Aug 2016 15:47:35 +0000 (17:47 +0200)
commitdc154cd1e497b02386b91fde28a658d79ec6659e
tree26f063740147073e6aa60ebf0349a261256712dc
parente6f9f287e226e44035920827be2a45753f7452d1
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>
(cherry picked from commit d3a28465fc7b7002f38cff364fdf601f7486add3)
src/osd/ReplicatedPG.cc
src/osd/ReplicatedPG.h