Skip to content

Commit cddbaa8

Browse files
Ming Leigregkh
authored andcommitted
nvme-tcp: fix potential unbalanced freeze & unfreeze
commit 99dc264 upstream. Move start_freeze into nvme_tcp_configure_io_queues(), and there is at least two benefits: 1) fix unbalanced freeze and unfreeze, since re-connection work may fail or be broken by removal 2) IO during error recovery can be failfast quickly because nvme fabrics unquiesces queues after teardown. One side-effect is that !mpath request may timeout during connecting because of queue topo change, but that looks not one big deal: 1) same problem exists with current code base 2) compared with !mpath, mpath use case is dominant Fixes: 2875b0a ("nvme-tcp: fix controller reset hang during traffic") Cc: stable@vger.kernel.org Signed-off-by: Ming Lei <ming.lei@redhat.com> Tested-by: Yi Zhang <yi.zhang@redhat.com> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Keith Busch <kbusch@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent bf67802 commit cddbaa8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/nvme/host/tcp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1890,6 +1890,7 @@ static int nvme_tcp_configure_io_queues(struct nvme_ctrl *ctrl, bool new)
18901890
goto out_cleanup_connect_q;
18911891

18921892
if (!new) {
1893+
nvme_start_freeze(ctrl);
18931894
nvme_start_queues(ctrl);
18941895
if (!nvme_wait_freeze_timeout(ctrl, NVME_IO_TIMEOUT)) {
18951896
/*
@@ -1898,6 +1899,7 @@ static int nvme_tcp_configure_io_queues(struct nvme_ctrl *ctrl, bool new)
18981899
* to be safe.
18991900
*/
19001901
ret = -ENODEV;
1902+
nvme_unfreeze(ctrl);
19011903
goto out_wait_freeze_timed_out;
19021904
}
19031905
blk_mq_update_nr_hw_queues(ctrl->tagset,
@@ -2002,7 +2004,6 @@ static void nvme_tcp_teardown_io_queues(struct nvme_ctrl *ctrl,
20022004
if (ctrl->queue_count <= 1)
20032005
return;
20042006
nvme_stop_admin_queue(ctrl);
2005-
nvme_start_freeze(ctrl);
20062007
nvme_stop_queues(ctrl);
20072008
nvme_sync_io_queues(ctrl);
20082009
nvme_tcp_stop_io_queues(ctrl);

0 commit comments

Comments
 (0)