diff options
author | Louis Rilling <louis.rilling@kerlabs.com> | 2009-12-04 08:52:41 -0500 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-12-04 10:36:18 -0500 |
commit | 61cc74fbb87af6aa551a06a370590c9bc07e29d9 (patch) | |
tree | 351116a74bba13b016c730f777eca86b3b197e5e | |
parent | 3c764b7a654668dd04905841d6024f7b6aa843a5 (diff) |
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 <louis.rilling@kerlabs.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-rw-r--r-- | block/blk-ioc.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) | |||
80 | ioc->aic->exit(ioc->aic); | 80 | ioc->aic->exit(ioc->aic); |
81 | cfq_exit(ioc); | 81 | cfq_exit(ioc); |
82 | 82 | ||
83 | put_io_context(ioc); | ||
84 | } | 83 | } |
84 | put_io_context(ioc); | ||
85 | } | 85 | } |
86 | 86 | ||
87 | struct io_context *alloc_io_context(gfp_t gfp_flags, int node) | 87 | struct io_context *alloc_io_context(gfp_t gfp_flags, int node) |