summaryrefslogtreecommitdiff
path: root/drivers/nvme
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2021-05-26 18:23:18 +0300
committerChristoph Hellwig <hch@lst.de>2021-06-02 10:06:53 +0300
commit6622f9acd29cd4f6272720e827e6406f5a970cb0 (patch)
tree9cf44c00d2699bd63d8cde097cf42e9f08961009 /drivers/nvme
parent4237de2f73a669e4f89ac0aa2b44fb1a1d9ec583 (diff)
downloadlinux-6622f9acd29cd4f6272720e827e6406f5a970cb0.tar.xz
nvme-loop: do not warn for deleted controllers during reset
During concurrent reset and delete calls the reset workqueue is flushed, causing nvme_loop_reset_ctrl_work() to be executed when the controller is in state DELETING or DELETING_NOIO. But this is expected, so we shouldn't issue a WARN_ON here. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme')
-rw-r--r--drivers/nvme/target/loop.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/nvme/target/loop.c b/drivers/nvme/target/loop.c
index 209ad4bc2695..a5c4a1865026 100644
--- a/drivers/nvme/target/loop.c
+++ b/drivers/nvme/target/loop.c
@@ -465,8 +465,10 @@ static void nvme_loop_reset_ctrl_work(struct work_struct *work)
nvme_loop_shutdown_ctrl(ctrl);
if (!nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_CONNECTING)) {
- /* state change failure should never happen */
- WARN_ON_ONCE(1);
+ if (ctrl->ctrl.state != NVME_CTRL_DELETING &&
+ ctrl->ctrl.state != NVME_CTRL_DELETING_NOIO)
+ /* state change failure for non-deleted ctrl? */
+ WARN_ON_ONCE(1);
return;
}