Skip to content

Commit 6622f9a

Browse files
hreineckeChristoph Hellwig
authored andcommitted
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 <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent 4237de2 commit 6622f9a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/nvme/target/loop.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,10 @@ static void nvme_loop_reset_ctrl_work(struct work_struct *work)
465465
nvme_loop_shutdown_ctrl(ctrl);
466466

467467
if (!nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_CONNECTING)) {
468-
/* state change failure should never happen */
469-
WARN_ON_ONCE(1);
468+
if (ctrl->ctrl.state != NVME_CTRL_DELETING &&
469+
ctrl->ctrl.state != NVME_CTRL_DELETING_NOIO)
470+
/* state change failure for non-deleted ctrl? */
471+
WARN_ON_ONCE(1);
470472
return;
471473
}
472474

0 commit comments

Comments
 (0)