From: Daniel Wagner Date: Fri, 14 Feb 2025 08:02:03 +0000 (+0100) Subject: nvme: only allow entering LIVE from CONNECTING state X-Git-Tag: nvme-6.14-2025-02-20^0 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=d2fe192348f93fe3a0cb1e33e4aba58e646397f4;p=nvme.git nvme: only allow entering LIVE from CONNECTING state The fabric transports and also the PCI transport are not entering the LIVE state from NEW or RESETTING. This makes the state machine more restrictive and allows to catch not supported state transitions, e.g. directly switching from RESETTING to LIVE. Reviewed-by: Sagi Grimberg Signed-off-by: Daniel Wagner Signed-off-by: Keith Busch --- diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 818d4e49aab5..f028913e2e62 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -564,8 +564,6 @@ bool nvme_change_ctrl_state(struct nvme_ctrl *ctrl, switch (new_state) { case NVME_CTRL_LIVE: switch (old_state) { - case NVME_CTRL_NEW: - case NVME_CTRL_RESETTING: case NVME_CTRL_CONNECTING: changed = true; fallthrough;