From: Hannes Reinecke Date: Wed, 26 May 2021 15:23:18 +0000 (+0200) Subject: nvme-loop: do not warn for deleted controllers during reset X-Git-Tag: v5.15~981^2~4^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6622f9acd29cd4f6272720e827e6406f5a970cb0;p=platform%2Fkernel%2Flinux-starfive.git 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 Signed-off-by: Christoph Hellwig --- diff --git a/drivers/nvme/target/loop.c b/drivers/nvme/target/loop.c index 209ad4b..a5c4a18 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; }