Commit 61cc74fbb87af6aa551a06a370590c9bc07e29d9

Authored by Louis Rilling
Committed by Jens Axboe
1 parent 3c764b7a65

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>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

... ... @@ -80,8 +80,8 @@
80 80 ioc->aic->exit(ioc->aic);
81 81 cfq_exit(ioc);
82 82  
83   - put_io_context(ioc);
84 83 }
  84 + put_io_context(ioc);
85 85 }
86 86  
87 87 struct io_context *alloc_io_context(gfp_t gfp_flags, int node)