linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] blk-mq: fix error handling in __blk_mq_alloc_disk
@ 2022-07-20 13:05 Christoph Hellwig
  2022-07-20 13:05 ` [PATCH 2/2] block: call blk_mq_exit_queue from disk_release for never added disks Christoph Hellwig
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Christoph Hellwig @ 2022-07-20 13:05 UTC (permalink / raw)
  To: axboe; +Cc: linux-block

To fully clean up the queue if the disk allocation fails we need to
call blk_mq_destroy_queue and not just blk_put_queue.

Fixes: 6f8191fdf41d ("block: simplify disk shutdown")
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 block/blk-mq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index d716b7f3763f3..70177ee74295b 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -3960,7 +3960,7 @@ struct gendisk *__blk_mq_alloc_disk(struct blk_mq_tag_set *set, void *queuedata,
 
 	disk = __alloc_disk_node(q, set->numa_node, lkclass);
 	if (!disk) {
-		blk_put_queue(q);
+		blk_mq_destroy_queue(q);
 		return ERR_PTR(-ENOMEM);
 	}
 	set_bit(GD_OWNS_QUEUE, &disk->state);
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-07-21 16:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-20 13:05 [PATCH 1/2] blk-mq: fix error handling in __blk_mq_alloc_disk Christoph Hellwig
2022-07-20 13:05 ` [PATCH 2/2] block: call blk_mq_exit_queue from disk_release for never added disks Christoph Hellwig
2022-07-21 12:07   ` Ming Lei
2022-07-20 23:55 ` [PATCH 1/2] blk-mq: fix error handling in __blk_mq_alloc_disk Ming Lei
2022-07-21  5:03   ` Christoph Hellwig
2022-07-21  7:12     ` Ming Lei
2022-07-21 16:59 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).