Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Maurizio Lombardi <mlombard@arkamax.eu>
Cc: Hannes Reinecke <hare@suse.de>,
	Maurizio Lombardi <mlombard@redhat.com>,
	kbusch@kernel.org, mheyne@amazon.de, emilne@redhat.com,
	jmeneghi@redhat.com, linux-nvme@lists.infradead.org,
	dwagner@suse.de, mkhalfella@purestorage.com,
	chaitanyak@nvidia.com, hare@kernel.org, hch@lst.de
Subject: Re: [PATCH V5 7/7] nvme-core: warn on allocating admin tag set with existing queue
Date: Tue, 19 May 2026 13:56:24 +0200	[thread overview]
Message-ID: <20260519115624.GA31422@lst.de> (raw)
In-Reply-To: <DIMJT6826UO7.5S1W29JK9I7D@arkamax.eu>

On Tue, May 19, 2026 at 11:33:28AM +0200, Maurizio Lombardi wrote:
> >> +	WARN_ON_ONCE(ctrl->admin_q);
> >>   
> >>   	ctrl->admin_q = blk_mq_alloc_queue(set, NULL, NULL);
> >>   	if (IS_ERR(ctrl->admin_q)) {
> >
> > Why don't you return an error here?
> > The WARN_ON() now introduces a memory leak (at best); I'd rather
> > not do that here as we can easily recover here.
> 
> Ok if I just do the following?
> 
> if (WARN_ON_ONCE(ctrl->admin_q))
> 	blk_put_queue(ctrl->admin_q);

No, please keep it as is.  The whole point of the WARN_ON is that
it should catch impossible conditions.  Leaking a reference is the
least of our problems when it triggers.



  reply	other threads:[~2026-05-19 11:56 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-14  8:32 [PATCH V5 0/7] nvme: Refactor and expose per-controller timeout configuration Maurizio Lombardi
2026-05-14  8:32 ` [PATCH V5 1/7] nvme: Let the blocklayer set timeouts for requests Maurizio Lombardi
2026-05-19  8:47   ` Hannes Reinecke
2026-05-14  8:32 ` [PATCH V5 2/7] nvme: remove redundant timeout argument from nvme_wait_freeze_timeout Maurizio Lombardi
2026-05-15  4:30   ` Christoph Hellwig
2026-05-19  8:48   ` Hannes Reinecke
2026-05-14  8:32 ` [PATCH V5 3/7] nvme: add sysfs attribute to change admin timeout per nvme controller Maurizio Lombardi
2026-05-14 16:59   ` Mohamed Khalfella
2026-05-15  5:54     ` Maurizio Lombardi
2026-05-15  4:30   ` Christoph Hellwig
2026-05-19  8:49   ` Hannes Reinecke
2026-05-14  8:32 ` [PATCH V5 4/7] nvme: add sysfs attribute to change IO timeout per controller Maurizio Lombardi
2026-05-15  4:31   ` Christoph Hellwig
2026-05-19  8:50   ` Hannes Reinecke
2026-05-14  8:32 ` [PATCH V5 5/7] nvme-core: align fabrics_q teardown with admin_q in nvme_free_ctrl Maurizio Lombardi
2026-05-14  8:32 ` [PATCH V5 6/7] nvmet-loop: do not alloc admin tag set during reset Maurizio Lombardi
2026-05-14  8:32 ` [PATCH V5 7/7] nvme-core: warn on allocating admin tag set with existing queue Maurizio Lombardi
2026-05-19  8:52   ` Hannes Reinecke
2026-05-19  9:33     ` Maurizio Lombardi
2026-05-19 11:56       ` Christoph Hellwig [this message]
2026-05-20 19:22 ` [PATCH V5 0/7] nvme: Refactor and expose per-controller timeout configuration Keith Busch

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=20260519115624.GA31422@lst.de \
    --to=hch@lst.de \
    --cc=chaitanyak@nvidia.com \
    --cc=dwagner@suse.de \
    --cc=emilne@redhat.com \
    --cc=hare@kernel.org \
    --cc=hare@suse.de \
    --cc=jmeneghi@redhat.com \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=mheyne@amazon.de \
    --cc=mkhalfella@purestorage.com \
    --cc=mlombard@arkamax.eu \
    --cc=mlombard@redhat.com \
    /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