Christoph Hellwig c57094a6e1 md: fix error handling in md_alloc
Error handling in md_alloc is a mess.  Untangle it to just free the mddev
directly before add_disk is called and thus the gendisk is globally
visible.  After that clear the hold flag and let the mddev_put take care
of cleaning up the mddev through the usual mechanisms.

Fixes: 5e55e2f5fc95 ("[PATCH] md: convert compile time warnings into runtime warnings")
Fixes: 9be68dd7ac0e ("md: add error handling support for add_disk()")
Fixes: 7ad1069166c0 ("md: properly unwind when failing to add the kobject in md_alloc")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Song Liu <song@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-08-02 17:22:43 -06:00
..
2022-08-02 11:12:25 -07:00
2022-08-02 08:10:10 -07:00
2022-07-29 19:58:52 +02:00
2022-06-28 06:33:15 -06:00
2022-08-02 08:10:10 -07:00
2022-08-02 08:10:10 -07:00
2022-07-29 13:25:31 -07:00
2022-08-02 11:07:04 -07:00
2022-08-02 08:10:10 -07:00
2022-08-02 13:46:35 -07:00
2022-07-17 07:52:46 -07:00
2022-08-02 08:29:18 -07:00
2022-06-02 15:23:54 -07:00
2022-08-02 17:22:43 -06:00
2022-06-28 06:33:15 -06:00
2022-08-02 11:12:25 -07:00
2022-08-02 13:46:35 -07:00
2022-08-02 13:46:35 -07:00
2022-08-02 13:46:35 -07:00
2022-06-02 15:23:54 -07:00
2022-07-29 19:58:52 +02:00
2022-07-29 13:41:18 +02:00
2022-06-03 11:48:47 -07:00
2022-06-02 15:23:54 -07:00
2022-08-02 13:46:35 -07:00
2022-08-02 13:46:35 -07:00
2022-06-03 11:48:47 -07:00
2022-08-02 08:10:10 -07:00
2022-08-02 10:55:04 -07:00
2022-05-11 08:29:11 +03:00
2022-08-02 13:46:35 -07:00
2022-08-02 08:10:10 -07:00
2022-08-02 13:46:35 -07:00
2022-07-29 19:58:52 +02:00
2022-06-05 09:25:12 -07:00
2022-06-05 09:25:12 -07:00