File 0013-nvme-cli-Revert-stop-on-failure-with-connect-all.patch of Package nvme-cli.11346

From 4a6c247971ce8e7a4af7f976be8906c907ef13cf Mon Sep 17 00:00:00 2001
From: James Smart <>
Date: Tue, 9 Apr 2019 13:51:54 -0700
Subject: [PATCH] nvme-cli: Revert stop-on-failure with connect-all

The patch that added special treatment for EALREADY connect failures
also changed the behavior on what happens if a discovery log contains
an entry that is not connectable by the system or host port. If it
encounters a log entry that can't be connected to, it will not attempt
to connect to any log entries beyond it. This can leave lots of devices
unconnected to.

Revert the stop-on-failure introduced by the previous patch.

Specifically, this failed for me on an FC array that had a discovery log
entry for a port that was not visible via zoning for the initiator
port being used.

Fixes: 1a922e0e121d7 ("connect-all: special treatment to EALREADY afetr write to /dev/nvme-fabrics"
Signed-off-by: James Smart <>
CC: Eyal Ben David <>
CC: Martin George <>
 fabrics.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/fabrics.c b/fabrics.c
index 2b08be5..aad399d 100644
--- a/fabrics.c
+++ b/fabrics.c
@@ -817,9 +817,12 @@ static int connect_ctrls(struct nvmf_disc_rsp_page_hdr *log, int numrec)
-		/* otherwise error */
-		ret = -instance;
-		break;
+		/*
+		 * don't error out. The Discovery Log may contain
+		 * devices that aren't necessarily connectable via
+		 * the system/host transport port. Let those items
+		 * fail and continue on to the next log element.
+		 */
 	return ret;
openSUSE Build Service is sponsored by