From: Ming Lei <ming.lei@redhat.com>
To: Christoph Hellwig <hch@lst.de>
Cc: axboe@kernel.dk, linux-block@vger.kernel.org
Subject: Re: [PATCH 1/2] blk-mq: fix error handling in __blk_mq_alloc_disk
Date: Thu, 21 Jul 2022 15:12:27 +0800 [thread overview]
Message-ID: <Ytj8WwwxH+ZxpSSJ@T590> (raw)
In-Reply-To: <20220721050332.GA19443@lst.de>
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@redhat.com>
Thanks,
Ming
next prev parent reply other threads:[~2022-07-21 7:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2022-07-21 16:59 ` Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Ytj8WwwxH+ZxpSSJ@T590 \
--to=ming.lei@redhat.com \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).