]> www.infradead.org Git - users/willy/pagecache.git/commitdiff
nvme: only allow entering LIVE from CONNECTING state
authorDaniel Wagner <wagi@kernel.org>
Fri, 14 Feb 2025 08:02:03 +0000 (09:02 +0100)
committerKeith Busch <kbusch@kernel.org>
Thu, 20 Feb 2025 17:14:25 +0000 (09:14 -0800)
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 <sagi@grimberg.me>
Signed-off-by: Daniel Wagner <wagi@kernel.org>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/host/core.c

index 818d4e49aab51c388af9a48bf9d466fea9cef51b..f028913e2e622ee348e88879c6e6b7e8f8a1cc82 100644 (file)
@@ -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;