nvme-tcp: fix reset hang if controller died in the middle of a reset
authorSagi Grimberg <sagi@grimberg.me>
Thu, 30 Jul 2020 20:25:34 +0000 (13:25 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Sep 2020 11:47:47 +0000 (13:47 +0200)
commitbb018c73500b67362aedaa40e5c8d18da240256d
tree8d54b436419366d7999a7de4a12f1f45223c7ea1
parent34b1b26b2d8fa89d03accd6d1f48e8c346afc047
nvme-tcp: fix reset hang if controller died in the middle of a reset

[ Upstream commit e5c01f4f7f623e768e868bcc08d8e7ceb03b75d0 ]

If the controller becomes unresponsive in the middle of a reset, we will
hang because we are waiting for the freeze to complete, but that cannot
happen since we have commands that are inflight holding the
q_usage_counter, and we can't blindly fail requests that times out.

So give a timeout and if we cannot wait for queue freeze before
unfreezing, fail and have the error handling take care how to proceed
(either schedule a reconnect of remove the controller).

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/host/tcp.c