]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
client: hold reference for returned inode
authorYan, Zheng <zyan@redhat.com>
Sat, 23 May 2015 12:01:46 +0000 (20:01 +0800)
committerYan, Zheng <zyan@redhat.com>
Mon, 3 Aug 2015 07:42:33 +0000 (15:42 +0800)
commitad9c22a4ca56d7ad3c1666795bd8c9785eaccf70
tree505759a74c0ee1b8f36ec12225032e379f83065c
parentef86e29259d0e863e62115926bf67287dc9a7e41
client: hold reference for returned inode

CLient::make_request() returns pointer of target inode, but it does not
increase reference count of the returned inode. The inode may get freed
when CLient::make_request() releases MetaRequest.

he fix is hold a reference for the returned inode. Since there are many
of places use CLient::make_request() directly or indirectly, it's easy
to leak reference. This patch uses intrusive_ptr to track the reference.

Signed-off-by: Yan, Zheng <zyan@redhat.com>
src/client/Client.cc
src/client/Client.h
src/client/Inode.cc
src/client/Inode.h
src/client/InodeRef.h [new file with mode: 0644]