From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Hannes Reinecke <hare@suse.de>,
Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>,
Christoph Hellwig <hch@lst.de>, Sasha Levin <sashal@kernel.org>,
linux-nvme@lists.infradead.org
Subject: [PATCH AUTOSEL 4.19 14/21] nvme-loop: reset queue count to 1 in nvme_loop_destroy_io_queues()
Date: Mon, 7 Jun 2021 12:14:41 -0400 [thread overview]
Message-ID: <20210607161448.3584332-14-sashal@kernel.org> (raw)
In-Reply-To: <20210607161448.3584332-1-sashal@kernel.org>
From: Hannes Reinecke <hare@suse.de>
[ Upstream commit a6c144f3d2e230f2b3ac5ed8c51e0f0391556197 ]
The queue count is increased in nvme_loop_init_io_queues(), so we
need to reset it to 1 at the end of nvme_loop_destroy_io_queues().
Otherwise the function is not re-entrant safe, and crash will happen
during concurrent reset and remove calls.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/nvme/target/loop.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/nvme/target/loop.c b/drivers/nvme/target/loop.c
index 137a27fa369c..7b6e44ed299a 100644
--- a/drivers/nvme/target/loop.c
+++ b/drivers/nvme/target/loop.c
@@ -309,6 +309,7 @@ static void nvme_loop_destroy_io_queues(struct nvme_loop_ctrl *ctrl)
clear_bit(NVME_LOOP_Q_LIVE, &ctrl->queues[i].flags);
nvmet_sq_destroy(&ctrl->queues[i].nvme_sq);
}
+ ctrl->ctrl.queue_count = 1;
}
static int nvme_loop_init_io_queues(struct nvme_loop_ctrl *ctrl)
--
2.30.2
next prev parent reply other threads:[~2021-06-07 16:24 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-07 16:14 [PATCH AUTOSEL 4.19 01/21] net: ieee802154: fix null deref in parse dev addr Sasha Levin
2021-06-07 16:14 ` [PATCH AUTOSEL 4.19 02/21] HID: quirks: Set INCREMENT_USAGE_ON_DUPLICATE for Saitek X65 Sasha Levin
2021-06-07 16:14 ` [PATCH AUTOSEL 4.19 03/21] HID: hid-sensor-hub: Return error for hid_set_field() failure Sasha Levin
2021-06-07 16:14 ` [PATCH AUTOSEL 4.19 04/21] HID: Add BUS_VIRTUAL to hid_connect logging Sasha Levin
2021-06-07 16:14 ` [PATCH AUTOSEL 4.19 05/21] HID: usbhid: fix info leak in hid_submit_ctrl Sasha Levin
2021-06-07 16:14 ` [PATCH AUTOSEL 4.19 06/21] ARM: OMAP2+: Fix build warning when mmc_omap is not built Sasha Levin
2021-06-07 16:14 ` [PATCH AUTOSEL 4.19 07/21] gfs2: Prevent direct-I/O write fallback errors from getting lost Sasha Levin
2021-06-07 16:14 ` [PATCH AUTOSEL 4.19 08/21] HID: gt683r: add missing MODULE_DEVICE_TABLE Sasha Levin
2021-06-07 16:14 ` [PATCH AUTOSEL 4.19 09/21] gfs2: Fix use-after-free in gfs2_glock_shrink_scan Sasha Levin
2021-06-07 16:14 ` [PATCH AUTOSEL 4.19 10/21] Bluetooth: use correct lock to prevent UAF of hdev object Sasha Levin
2021-06-07 16:14 ` [PATCH AUTOSEL 4.19 11/21] scsi: target: core: Fix warning on realtime kernels Sasha Levin
2021-06-07 16:14 ` [PATCH AUTOSEL 4.19 12/21] ethernet: myri10ge: Fix missing error code in myri10ge_probe() Sasha Levin
2021-06-07 16:14 ` [PATCH AUTOSEL 4.19 13/21] scsi: scsi_devinfo: Add blacklist entry for HPE OPEN-V Sasha Levin
2021-06-07 16:14 ` Sasha Levin [this message]
2021-06-07 16:14 ` [PATCH AUTOSEL 4.19 15/21] nvme-loop: clear NVME_LOOP_Q_LIVE when nvme_loop_configure_admin_queue() fails Sasha Levin
2021-06-07 16:14 ` [PATCH AUTOSEL 4.19 16/21] nvme-loop: check for NVME_LOOP_Q_LIVE in nvme_loop_destroy_admin_queue() Sasha Levin
2021-06-07 16:14 ` [PATCH AUTOSEL 4.19 17/21] net: ipconfig: Don't override command-line hostnames or domains Sasha Levin
2021-06-07 16:14 ` [PATCH AUTOSEL 4.19 18/21] rtnetlink: Fix missing error code in rtnl_bridge_notify() Sasha Levin
2021-06-07 16:14 ` [PATCH AUTOSEL 4.19 19/21] net/x25: Return the correct errno code Sasha Levin
2021-06-07 16:14 ` [PATCH AUTOSEL 4.19 20/21] net: " Sasha Levin
2021-06-07 16:14 ` [PATCH AUTOSEL 4.19 21/21] fib: " Sasha Levin
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=20210607161448.3584332-14-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=chaitanya.kulkarni@wdc.com \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=stable@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