block: add error handling for device_add_disk / add_disk
authorLuis Chamberlain <mcgrof@kernel.org>
Wed, 18 Aug 2021 14:45:40 +0000 (16:45 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 23 Aug 2021 18:55:45 +0000 (12:55 -0600)
commit83cbce9574462c6b4eed6797bdaf18fae6859ab3
treed0457ade896747cff5f3f2d660b2b445ef97c908
parent92e7755ebc69233e25a2d1b760aeff536dc4016b
block: add error handling for device_add_disk / add_disk

Properly unwind on errors in device_add_disk.  This is the initial work
as drivers are not converted yet, which will follow in separate patches.

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
[hch: major rebase.  All bugs are probably mine]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Link: https://lore.kernel.org/r/20210818144542.19305-10-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/genhd.c
include/linux/genhd.h