On Thu, Jul 21, 2022 at 07:03:32AM +0200, Christoph Hellwig wrote: > On Thu, Jul 21, 2022 at 07:55:03AM +0800, Ming Lei wrote: > > > 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); > > > > The same change is needed in case of blk_mq_init_allocated_queue() failure too. > > I don't think so. blk_mq_init_allocated_queue only calls > blk_mq_add_queue_tag_set at the very end, after any failure point, > and the last failure point is blk_mq_realloc_hw_ctxs not mapping > any queues. So what would we clean up when > blk_mq_init_allocated_queue fails? OK, miss that, so looks fine: Reviewed-by: Ming Lei <ming.lei@xxxxxxxxxx> Thanks, Ming