Browse Source

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>
Tal Shorer 7 years ago
parent
commit
66414e8024
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/nvme/host/fabrics.c

+ 1 - 1
drivers/nvme/host/fabrics.c

@@ -474,7 +474,7 @@ EXPORT_SYMBOL_GPL(nvmf_connect_io_queue);
 
 
 bool nvmf_should_reconnect(struct nvme_ctrl *ctrl)
 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)
 	    ctrl->nr_reconnects < ctrl->opts->max_reconnects)
 		return true;
 		return true;