All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: axboe@kernel.dk
Cc: kbusch@kernel.org, sagi@grimberg.me,
	linux-nvme@lists.infradead.org, linux-block@vger.kernel.org,
	Kanchan Joshi <joshi.k@samsung.com>
Subject: [PATCH 2/2] nvme: cancel the queue limit update when nvme_update_zone_info fails
Date: Wed, 27 Mar 2024 18:21:45 +0100	[thread overview]
Message-ID: <20240327172145.2844065-2-hch@lst.de> (raw)
In-Reply-To: <20240327172145.2844065-1-hch@lst.de>

Starting an atomic queue limits update takes a mutex and thus needs
to be finished, or with the newly added helper, canceled to not leak
the lock critical section.

Fixes: 9b130d681443 ("nvme: use the atomic queue limits update API")
Reported-by: Kanchan Joshi <joshi.k@samsung.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/nvme/host/core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 943d72bdd794ca..f8a9565bee41d2 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -2115,6 +2115,7 @@ static int nvme_update_ns_info_block(struct nvme_ns *ns,
 	    ns->head->ids.csi == NVME_CSI_ZNS) {
 		ret = nvme_update_zone_info(ns, lbaf, &lim);
 		if (ret) {
+			queue_limits_cancel_update(ns->disk->queue);
 			blk_mq_unfreeze_queue(ns->disk->queue);
 			goto out;
 		}
-- 
2.39.2


  reply	other threads:[~2024-03-27 17:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20240327172205epcas5p356fffa2ae1916fa1479c2c75e4215cd1@epcas5p3.samsung.com>
2024-03-27 17:21 ` [PATCH 1/2] block: add a helper to cancel atomic queue limit updates Christoph Hellwig
2024-03-27 17:21   ` Christoph Hellwig [this message]
2024-03-27 18:01     ` [PATCH 2/2] nvme: cancel the queue limit update when nvme_update_zone_info fails Keith Busch
2024-03-28  3:03   ` [PATCH 1/2] block: add a helper to cancel atomic queue limit updates Kanchan Joshi

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=20240327172145.2844065-2-hch@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=joshi.k@samsung.com \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.