Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

nvme-rdma: Make sure to shutdown the controller if we can

Relying on ctrl state in nvme_rdma_shutdown_ctrl is wrong because
it will never be NVME_CTRL_LIVE (delete_ctrl or reset_ctrl invoked it).

Instead, check that the admin queue is connected. Note that it is safe
because we can never see a copmeting thread trying to destroy the admin
queue (reset or delete controller).

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Christoph Hellwig <hch@lst.de>

+1 -1
+1 -1
drivers/nvme/host/rdma.c
··· 1646 1646 nvme_rdma_free_io_queues(ctrl); 1647 1647 } 1648 1648 1649 - if (ctrl->ctrl.state == NVME_CTRL_LIVE) 1649 + if (test_bit(NVME_RDMA_Q_CONNECTED, &ctrl->queues[0].flags)) 1650 1650 nvme_shutdown_ctrl(&ctrl->ctrl); 1651 1651 1652 1652 blk_mq_stop_hw_queues(ctrl->ctrl.admin_q);