From: Hannes Reinecke <hare@suse.de>
To: Christoph Hellwig <hch@lst.de>
Cc: Sagi Grimberg <sagi@grimberg.me>,
Keith Busch <keith.busch@wdc.com>,
linux-nvme@lists.infradead.org, Hannes Reinecke <hare@suse.de>
Subject: [PATCH 1/4] nvme/loop: reset queue count to 1 in nvme_loop_destroy_io_queues()
Date: Wed, 26 May 2021 17:23:15 +0200 [thread overview]
Message-ID: <20210526152318.107202-2-hare@suse.de> (raw)
In-Reply-To: <20210526152318.107202-1-hare@suse.de>
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>
---
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 74b3b150e1a5..f96ec84db8c2 100644
--- a/drivers/nvme/target/loop.c
+++ b/drivers/nvme/target/loop.c
@@ -299,6 +299,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.29.2
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
next prev parent reply other threads:[~2021-05-26 16:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-26 15:23 [PATCH 0/4] nvme-loop: fixes for concurrent reset and delete Hannes Reinecke
2021-05-26 15:23 ` Hannes Reinecke [this message]
2021-06-01 17:39 ` [PATCH 1/4] nvme/loop: reset queue count to 1 in nvme_loop_destroy_io_queues() Chaitanya Kulkarni
2021-05-26 15:23 ` [PATCH 2/4] nvme/loop: clear NVME_LOOP_Q_LIVE when nvme_loop_configure_admin_queue() fails Hannes Reinecke
2021-06-01 17:41 ` Chaitanya Kulkarni
2021-05-26 15:23 ` [PATCH 3/4] nvme/loop: check for NVME_LOOP_Q_LIVE in nvme_loop_destroy_admin_queue() Hannes Reinecke
2021-06-01 17:43 ` Chaitanya Kulkarni
2021-05-26 15:23 ` [PATCH 4/4] nvme/loop: Do not warn for deleted controllers during reset Hannes Reinecke
2021-06-02 7:07 ` [PATCH 0/4] nvme-loop: fixes for concurrent reset and delete Christoph Hellwig
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=20210526152318.107202-2-hare@suse.de \
--to=hare@suse.de \
--cc=hch@lst.de \
--cc=keith.busch@wdc.com \
--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.