blk-mq: fix deadlock in blk_mq_register_disk() error path
authorJens Axboe <axboe@fb.com>
Tue, 2 Aug 2016 14:45:44 +0000 (08:45 -0600)
committerJens Axboe <axboe@fb.com>
Tue, 2 Aug 2016 14:45:44 +0000 (08:45 -0600)
commit6316338a94b2319abe9d3790eb9cdc56ef81ac1a
tree7676e21956e00940c7c535f6b12edce0f2184d69
parent9fb755f03f6b561a9a5b59d83ed6ea465a65d1cb
blk-mq: fix deadlock in blk_mq_register_disk() error path

If we fail registering any of the hardware queues, we call
into blk_mq_unregister_disk() with the hotplug mutex already
held. Since blk_mq_unregister_disk() attempts to acquire the
same mutex, we end up in a less than happy place.

Reported-by: Jinpu Wang <jinpu.wang@profitbricks.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-mq-sysfs.c