]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
rbd: fix osd_request memory leak in __rbd_dev_header_watch_sync()
authorIlya Dryomov <ilya.dryomov@inktank.com>
Thu, 22 May 2014 15:28:52 +0000 (19:28 +0400)
committerYan, Zheng <zheng.z.yan@intel.com>
Fri, 6 Jun 2014 01:29:59 +0000 (09:29 +0800)
commitb30a01f2a307f55a505762ba09c0440d906c6711
tree7f9ff0633c8dfef285ef546117b40867df9be710
parent30ba1f020221991cf239d905c82984958f29bdfe
rbd: fix osd_request memory leak in __rbd_dev_header_watch_sync()

osd_request, along with r_request and r_reply messages attached to it
are leaked in __rbd_dev_header_watch_sync() if the requested image
doesn't exist.  This is because lingering requests are special and get
an extra ref in the reply path.  Fix it by unregistering linger request
on the error path and split __rbd_dev_header_watch_sync() into two
functions to make it maintainable.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
drivers/block/rbd.c