• Ilya Dryomov's avatar
    rbd: fix error handling around rbd_init_disk() · 5769ed0c
    Ilya Dryomov authored
    add_disk() takes an extra reference on disk->queue, which is put in
    put_disk() -> disk_release().  Avoiding blk_cleanup_queue() (which also
    puts the queue) until add_disk() sets GENHD_FL_UP works for the queue
    itself, but leaks various queue internals.  Conditioning tag_set freeing
    on GENHD_FL_UP is wrong too: all error paths after rbd_init_disk() leak
    the tag_set.
    
    Move the final "announce" steps out of rbd_dev_device_setup() so that
    it can be unwound like any other function.  Leave "announce" steps to
    do_rbd_add/remove().
    Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
    Reviewed-by: default avatarJason Dillaman <dillaman@redhat.com>
    5769ed0c
rbd.c 164 KB