aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nvme
diff options
context:
space:
mode:
authorTal Shorer <tal.shorer@gmail.com>2018-08-07 23:42:39 +0300
committerChristoph Hellwig <hch@lst.de>2018-08-08 12:01:49 +0200
commit66414e80245e1e73222f67ee711951c7f4bdedab (patch)
treeec49043b572039f53f84b457c11145a4b885aa27 /drivers/nvme
parentnvmet: add ns write protect support (diff)
downloadlinux-dev-66414e80245e1e73222f67ee711951c7f4bdedab.tar.xz
linux-dev-66414e80245e1e73222f67ee711951c7f4bdedab.zip
nvme-fabrics: fix ctrl_loss_tmo < 0 to reconnect forever
When the user supplies a ctrl_loss_tmo < 0, we warn them that this will cause the fabrics layer to attempt reconnection forever. However, in reality the fabrics layer never attempts to reconnect because the condition to test whether we should reconnect is backwards in this case. Signed-off-by: Tal Shorer <tal.shorer@gmail.com> Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme')
-rw-r--r--drivers/nvme/host/fabrics.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c
index 903eb4545e26..3c6cd0f81ba6 100644
--- a/drivers/nvme/host/fabrics.c
+++ b/drivers/nvme/host/fabrics.c
@@ -474,7 +474,7 @@ EXPORT_SYMBOL_GPL(nvmf_connect_io_queue);
bool nvmf_should_reconnect(struct nvme_ctrl *ctrl)
{
- if (ctrl->opts->max_reconnects != -1 &&
+ if (ctrl->opts->max_reconnects == -1 ||
ctrl->nr_reconnects < ctrl->opts->max_reconnects)
return true;