lkml.org 
[lkml]   [2009]   [Dec]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 1/2] block: Fix io_context leak after clone with CLONE_IO
    Date
    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>
    ---
    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 d4ed600..dcd0412 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)
    --
    1.5.6.5


    \
     
     \ /
      Last update: 2009-12-04 14:55    [W:5.100 / U:0.000 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site