lkml.org 
[lkml]   [2009]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[21/99] dm: add missing del_gendisk to alloc_dev error path
    2.6.31-stable review patch.  If anyone has any objections, please let us know.

    ------------------
    From: Zdenek Kabelac <zkabelac@redhat.com>

    commit 03022c54b9725026c0370a810168975c387ad04c upstream.

    Add missing del_gendisk() to error path when creation of workqueue fails.
    Otherwice there is a resource leak and following warning is shown:

    WARNING: at fs/sysfs/dir.c:487 sysfs_add_one+0xc5/0x160()
    sysfs: cannot create duplicate filename '/devices/virtual/block/dm-0'

    Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
    Reviewed-by: Jonathan Brassow <jbrassow@redhat.com>
    Signed-off-by: Alasdair G Kergon <agk@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

    ---
    drivers/md/dm.c | 1 +
    1 file changed, 1 insertion(+)

    --- a/drivers/md/dm.c
    +++ b/drivers/md/dm.c
    @@ -1819,6 +1819,7 @@ static struct mapped_device *alloc_dev(i
    bad_bdev:
    destroy_workqueue(md->wq);
    bad_thread:
    + del_gendisk(md->disk);
    put_disk(md->disk);
    bad_disk:
    blk_cleanup_queue(md->queue);



    \
     
     \ /
      Last update: 2009-11-06 23:45    [W:0.027 / U:30.516 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site