Skip to content

Commit

Permalink
block: Fix io_context leak after clone with CLONE_IO
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Louis Rilling authored and Jens Axboe committed Dec 4, 2009
1 parent 3c764b7 commit 61cc74f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion block/blk-ioc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 61cc74f

Please sign in to comment.