From: Louis Rilling Date: Fri, 4 Dec 2009 13:52:41 +0000 (+0100) Subject: block: Fix io_context leak after clone with CLONE_IO X-Git-Tag: firefly_0821_release~9833^2~3959^2~7 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=61cc74fbb87af6aa551a06a370590c9bc07e29d9;p=firefly-linux-kernel-4.4.55.git block: Fix io_context leak after clone with CLONE_IO With CLONE_IO, copy_io() increments both ioc->refcount and ioc->nr_tasks. However exit_io_context() only decrements ioc->refcount if ioc->nr_tasks reaches 0. Always call put_io_context() in exit_io_context(). Signed-off-by: Louis Rilling Signed-off-by: Jens Axboe --- diff --git a/block/blk-ioc.c b/block/blk-ioc.c index d4ed6000147d..dcd041290b28 100644 --- a/block/blk-ioc.c +++ b/block/blk-ioc.c @@ -80,8 +80,8 @@ void exit_io_context(void) ioc->aic->exit(ioc->aic); cfq_exit(ioc); - put_io_context(ioc); } + put_io_context(ioc); } struct io_context *alloc_io_context(gfp_t gfp_flags, int node)