[iscsi-initiator-utils: 1/4] Resolves: #1081798
Chris Leech
cleech at fedoraproject.org
Fri Oct 24 00:08:10 UTC 2014
commit 3f3ec3512e4663489519216bb7e5bd0b1a53ccf2
Author: Chris Leech <cleech at redhat.com>
Date: Wed Sep 24 13:12:13 2014 -0700
Resolves: #1081798
retry login if a driver is still initializing, ISCSI_ERR_HOST_NOT_FOUND
sync with upstream for other minor fixes
...x-the-hostno-check-for-stats-submode-of-h.patch | 30 +++
0072-iscsiadm-Fix-the-compile-time-warning.patch | 31 +++
...iscsid-Fix-handling-of-iscsi-async-events.patch | 56 ++++++
...iscsi-Fix-MaxXmitDataLenght-of-the-driver.patch | 41 ++++
0076-Fix-StatSN-in-Open-iSCSI-Stack.patch | 61 ++++++
...-retry-login-for-ISCSI_ERR_HOST_NOT_FOUND.patch | 207 ++++++++++++++++++++
0078-iscsid-Fix-double-close-of-mgmt-ipc-fd.patch | 28 +++
...itialize-param_count-in-set_host_chap_inf.patch | 27 +++
...ke-iface.ipaddress-optional-in-iface-conf.patch | 100 ++++++++++
0082-Remove-unused-variable-path.patch | 33 +++
0083-Parse-origin-value-from-iBFT.patch | 81 ++++++++
...-docs-for-deregistering-discovery-domains.patch | 63 ++++++
...-version-string-to-match-RPM-package-vers.patch | 2 +-
iscsi-initiator-utils.spec | 34 +++-
14 files changed, 788 insertions(+), 6 deletions(-)
---
diff --git a/0071-iscsiadm-Fix-the-hostno-check-for-stats-submode-of-h.patch b/0071-iscsiadm-Fix-the-hostno-check-for-stats-submode-of-h.patch
new file mode 100644
index 0000000..6d588cd
--- /dev/null
+++ b/0071-iscsiadm-Fix-the-hostno-check-for-stats-submode-of-h.patch
@@ -0,0 +1,30 @@
+From f2ecc22d3cb0473b117a33e048a5a56cd8e9e46d Mon Sep 17 00:00:00 2001
+From: Chris Leech <cleech at redhat.com>
+Date: Mon, 24 Feb 2014 03:14:17 -0500
+Subject: [PATCH] iscsiadm: Fix the hostno check for stats submode of host mode
+
+This fixes the condition where hostno value of 0 was being treated
+as invalid.
+
+Signed-off-by: Chris Leech <cleech at redhat.com>
+Signed-off-by: Adheer Chandravanshi <adheer.chandravanshi at qlogic.com>
+---
+ usr/iscsiadm.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/usr/iscsiadm.c b/usr/iscsiadm.c
+index 3cde8d1..36617ab 100644
+--- a/usr/iscsiadm.c
++++ b/usr/iscsiadm.c
+@@ -3470,7 +3470,7 @@ main(int argc, char **argv)
+ ¶ms);
+ break;
+ case MODE_HOST_STATS:
+- if (!host_no) {
++ if (host_no > MAX_HOST_NO) {
+ log_error("STATS mode requires host no");
+ rc = ISCSI_ERR_INVAL;
+ break;
+--
+1.9.3
+
diff --git a/0072-iscsiadm-Fix-the-compile-time-warning.patch b/0072-iscsiadm-Fix-the-compile-time-warning.patch
new file mode 100644
index 0000000..3d54151
--- /dev/null
+++ b/0072-iscsiadm-Fix-the-compile-time-warning.patch
@@ -0,0 +1,31 @@
+From b1526306e413f0874d608637cd2a9f6571ea4d32 Mon Sep 17 00:00:00 2001
+From: Adheer Chandravanshi <adheer.chandravanshi at qlogic.com>
+Date: Mon, 24 Feb 2014 03:14:18 -0500
+Subject: [PATCH] iscsiadm: Fix the compile time warning
+
+This fixes the following compile time warning message:
+
+iscsiadm.c:2248: warning: passing argument 1 of 'print_host_stats' from incompatible pointer type
+
+Signed-off-by: Adheer Chandravanshi <adheer.chandravanshi at qlogic.com>
+---
+ usr/iscsiadm.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/usr/iscsiadm.c b/usr/iscsiadm.c
+index 36617ab..389f4b8 100644
+--- a/usr/iscsiadm.c
++++ b/usr/iscsiadm.c
+@@ -2245,7 +2245,8 @@ static int exec_host_stats_op(int op, int info_level, uint32_t host_no)
+ goto exit_host_stats;
+ }
+
+- print_host_stats(req_buf + sizeof(struct iscsi_uevent));
++ print_host_stats((struct iscsi_offload_host_stats *)(req_buf +
++ sizeof(struct iscsi_uevent)));
+
+ ipc->ctldev_close();
+
+--
+1.9.3
+
diff --git a/0074-iscsid-Fix-handling-of-iscsi-async-events.patch b/0074-iscsid-Fix-handling-of-iscsi-async-events.patch
new file mode 100644
index 0000000..b9a27d1
--- /dev/null
+++ b/0074-iscsid-Fix-handling-of-iscsi-async-events.patch
@@ -0,0 +1,56 @@
+From 36a8b41de43749d91dfd52f9c8ad4a454c9a8f15 Mon Sep 17 00:00:00 2001
+From: Mike Christie <michaelc at cs.wisc.edu>
+Date: Fri, 14 Mar 2014 01:41:29 -0500
+Subject: [PATCH] iscsid: Fix handling of iscsi async events.
+
+When iscsi targets send 32 or more iscsi async event pdus the
+initiator will run out of memory for events and this message:
+
+BUG: iscsid: Can not allocate memory for receive context.
+
+will be logged non stop. iscsid will then not be able to
+complate any more requests because it is stuck in a endless loop
+printing that message.
+
+This fixes the problem by having iscsid handle an event after it
+has read it in from netlink or the mgmt ipc. Previously we would
+queue all events then handle them.
+---
+ usr/event_poll.c | 5 ++++-
+ usr/netlink.c | 2 +-
+ 2 files changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/usr/event_poll.c b/usr/event_poll.c
+index f36fec1..939f1a2 100644
+--- a/usr/event_poll.c
++++ b/usr/event_poll.c
+@@ -165,8 +165,11 @@ void event_loop(struct iscsi_ipc *ipc, int control_fd, int mgmt_ipc_fd)
+ "exiting", res, errno);
+ break;
+ }
+- } else
++ }
++
++ if (res >= 0)
+ actor_poll();
++
+ reap_proc();
+ /*
+ * flush sysfs cache since kernel objs may
+diff --git a/usr/netlink.c b/usr/netlink.c
+index 1c4b5cc..532d9ef 100644
+--- a/usr/netlink.c
++++ b/usr/netlink.c
+@@ -1615,8 +1615,8 @@ static int ctldev_handle(void)
+
+ ev_context = ipc_ev_clbk->get_ev_context(conn, ev_size);
+ if (!ev_context) {
+- /* retry later */
+ log_error("Can not allocate memory for receive context.");
++ drop_data(nlh);
+ return -ENOMEM;
+ }
+
+--
+1.9.3
+
diff --git a/0075-be2iscsi-Fix-MaxXmitDataLenght-of-the-driver.patch b/0075-be2iscsi-Fix-MaxXmitDataLenght-of-the-driver.patch
new file mode 100644
index 0000000..2666f57
--- /dev/null
+++ b/0075-be2iscsi-Fix-MaxXmitDataLenght-of-the-driver.patch
@@ -0,0 +1,41 @@
+From 5f28b8b73fbdb8c1e7fbe4a0e40dd2857b74b685 Mon Sep 17 00:00:00 2001
+From: John Soni Jose <sony.john-n at emulex.com>
+Date: Fri, 21 Mar 2014 11:51:09 +0530
+Subject: [PATCH] be2iscsi: Fix MaxXmitDataLenght of the driver.
+
+ Issue :
+ During login negotiation if the MaxRecvDataSegmenLen given by the
+ target is 0, then MRDSL default value of 8K should be considered.
+ Some old targets close the CXN if the PDU received size is greater
+ than the MaxRecvDataSegmentLen set during negotiation.
+
+ Fix :
+ When target is not sending MaxRecvDataSegmentLen in the negotiated
+ params the value is 0. be2iscsi was setting max_xmit_dlength to 64k
+ in this case. This fix sets the MaxRecvDataSegmentLen=8k if during
+ negotiation the MaxRecvDataSegmentLen=0
+
+Signed-off-by: John Soni Jose <sony.john-n at emulex.com>
+Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal at emulex.com>
+---
+ usr/be2iscsi.c | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/usr/be2iscsi.c b/usr/be2iscsi.c
+index ce8b719..ba4c29f 100644
+--- a/usr/be2iscsi.c
++++ b/usr/be2iscsi.c
+@@ -33,10 +33,6 @@ void be2iscsi_create_conn(struct iscsi_conn *conn)
+ if (conn->max_xmit_dlength > 65536)
+ conn->max_xmit_dlength = 65536;
+
+- if (!conn_rec->iscsi.MaxXmitDataSegmentLength ||
+- conn_rec->iscsi.MaxXmitDataSegmentLength > 65536)
+- conn_rec->iscsi.MaxXmitDataSegmentLength = 65536;
+-
+ session->erl = 0;
+ session->initial_r2t_en = 1;
+ }
+--
+1.9.3
+
diff --git a/0076-Fix-StatSN-in-Open-iSCSI-Stack.patch b/0076-Fix-StatSN-in-Open-iSCSI-Stack.patch
new file mode 100644
index 0000000..0f623fd
--- /dev/null
+++ b/0076-Fix-StatSN-in-Open-iSCSI-Stack.patch
@@ -0,0 +1,61 @@
+From e696b94743d880c30c6e4e39c753e4d652845e85 Mon Sep 17 00:00:00 2001
+From: John Soni Jose <jose0here at gmail.com>
+Date: Fri, 21 Mar 2014 11:51:19 +0530
+Subject: [PATCH] Fix StatSN in Open-iSCSI Stack.
+
+ When LIO target is used, STATSN in login response can be in
+ the range 0x0 - 0xFFFFFFFF. Open-iSCSI Stack had the type
+ as ISCSI_INT for StatSN, so StatSN used to get reset to 0.
+
+ Adding new type ISCSI_UINT feild to fix this issue.
+
+Signed-off-by: John Soni Jose <sony.john-n at emulex.com>
+Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal at emulex.com>
+---
+ usr/initiator_common.c | 2 +-
+ usr/iscsi_ipc.h | 1 +
+ usr/netlink.c | 3 +++
+ 3 files changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/usr/initiator_common.c b/usr/initiator_common.c
+index 109e8d7..50f8d41 100644
+--- a/usr/initiator_common.c
++++ b/usr/initiator_common.c
+@@ -431,7 +431,7 @@ int iscsi_session_set_neg_params(struct iscsi_conn *conn)
+ }, {
+ .param = ISCSI_PARAM_EXP_STATSN,
+ .value = &conn->exp_statsn,
+- .type = ISCSI_INT,
++ .type = ISCSI_UINT,
+ .conn_only = 1,
+ }, {
+ .param = ISCSI_PARAM_TPGT,
+diff --git a/usr/iscsi_ipc.h b/usr/iscsi_ipc.h
+index 9d26d54..5087b5c 100644
+--- a/usr/iscsi_ipc.h
++++ b/usr/iscsi_ipc.h
+@@ -30,6 +30,7 @@
+
+ enum {
+ ISCSI_INT,
++ ISCSI_UINT,
+ ISCSI_STRING,
+ };
+
+diff --git a/usr/netlink.c b/usr/netlink.c
+index 532d9ef..b0dfb03 100644
+--- a/usr/netlink.c
++++ b/usr/netlink.c
+@@ -716,6 +716,9 @@ kset_param(uint64_t transport_handle, uint32_t sid, uint32_t cid,
+ case ISCSI_INT:
+ sprintf(param_str, "%d", *((int *)value));
+ break;
++ case ISCSI_UINT:
++ sprintf(param_str, "%u", *((unsigned int *)value));
++ break;
+ case ISCSI_STRING:
+ if (!strlen(value))
+ return 0;
+--
+1.9.3
+
diff --git a/0077-iscsid-retry-login-for-ISCSI_ERR_HOST_NOT_FOUND.patch b/0077-iscsid-retry-login-for-ISCSI_ERR_HOST_NOT_FOUND.patch
new file mode 100644
index 0000000..67d4dd2
--- /dev/null
+++ b/0077-iscsid-retry-login-for-ISCSI_ERR_HOST_NOT_FOUND.patch
@@ -0,0 +1,207 @@
+From c0e509e7535372cd5d655bc5a20d3d2bae45df84 Mon Sep 17 00:00:00 2001
+From: Mike Christie <michaelc at cs.wisc.edu>
+Date: Wed, 7 May 2014 14:38:13 -0500
+Subject: [PATCH] iscsid: retry login for ISCSI_ERR_HOST_NOT_FOUND
+
+If a driver is being loaded then the scsi_host might not yet
+be added. This has iscsid retry login if the host is not yet
+in sysfs.
+---
+ usr/initiator.c | 111 ++++++++++++++++++++++++++++++++++++++++++++++++++------
+ 1 file changed, 100 insertions(+), 11 deletions(-)
+
+diff --git a/usr/initiator.c b/usr/initiator.c
+index 05a5b19..b4b8957 100644
+--- a/usr/initiator.c
++++ b/usr/initiator.c
+@@ -55,10 +55,19 @@
+
+ #define PROC_DIR "/proc"
+
++struct login_task_retry_info {
++ actor_t retry_actor;
++ queue_task_t *qtask;
++ node_rec_t *rec;
++ int retry_count;
++};
++
+ static void iscsi_login_timedout(void *data);
+ static int iscsi_sched_ev_context(struct iscsi_ev_context *ev_context,
+ struct iscsi_conn *conn, unsigned long tmo,
+ int event);
++static int queue_session_login_task_retry(struct login_task_retry_info *info,
++ node_rec_t *rec, queue_task_t *qtask);
+
+ static int iscsi_ev_context_alloc(iscsi_conn_t *conn)
+ {
+@@ -324,14 +333,17 @@ session_release(iscsi_session_t *session)
+ }
+
+ static iscsi_session_t*
+-__session_create(node_rec_t *rec, struct iscsi_transport *t)
++__session_create(node_rec_t *rec, struct iscsi_transport *t, int *rc)
+ {
+ iscsi_session_t *session;
+- int hostno, rc = 0;
++ int hostno;
++
++ *rc = 0;
+
+ session = calloc(1, sizeof (*session));
+ if (session == NULL) {
+ log_debug(1, "can not allocate memory for session");
++ *rc = ISCSI_ERR_NOMEM;
+ return NULL;
+ }
+ log_debug(2, "Allocted session %p", session);
+@@ -356,8 +368,8 @@ __session_create(node_rec_t *rec, struct iscsi_transport *t)
+ session->initiator_name = dconfig->initiator_name;
+ else {
+ log_error("No initiator name set. Cannot create session.");
+- free(session);
+- return NULL;
++ *rc = ISCSI_ERR_INVAL;
++ goto free_session;
+ }
+
+ if (strlen(session->nrec.iface.alias))
+@@ -386,8 +398,8 @@ __session_create(node_rec_t *rec, struct iscsi_transport *t)
+
+ iscsi_session_init_params(session);
+
+- hostno = iscsi_sysfs_get_host_no_from_hwinfo(&rec->iface, &rc);
+- if (!rc) {
++ hostno = iscsi_sysfs_get_host_no_from_hwinfo(&rec->iface, rc);
++ if (!*rc) {
+ /*
+ * if the netdev or mac was set, then we are going to want
+ * to want to bind the all the conns/eps to a specific host
+@@ -395,10 +407,18 @@ __session_create(node_rec_t *rec, struct iscsi_transport *t)
+ */
+ session->conn[0].bind_ep = 1;
+ session->hostno = hostno;
++ } else if (*rc == ISCSI_ERR_HOST_NOT_FOUND) {
++ goto free_session;
++ } else {
++ *rc = 0;
+ }
+
+ list_add_tail(&session->list, &t->sessions);
+ return session;
++
++free_session:
++ free(session);
++ return NULL;
+ }
+
+ static void iscsi_flush_context_pool(struct iscsi_session *session)
+@@ -1862,8 +1882,7 @@ static int session_is_running(node_rec_t *rec)
+ return 0;
+ }
+
+-int
+-session_login_task(node_rec_t *rec, queue_task_t *qtask)
++static int __session_login_task(node_rec_t *rec, queue_task_t *qtask)
+ {
+ iscsi_session_t *session;
+ iscsi_conn_t *conn;
+@@ -1930,8 +1949,10 @@ session_login_task(node_rec_t *rec, queue_task_t *qtask)
+ rec->conn[0].iscsi.OFMarker = 0;
+ }
+
+- session = __session_create(rec, t);
+- if (!session)
++ session = __session_create(rec, t, &rc);
++ if (rc == ISCSI_ERR_HOST_NOT_FOUND)
++ return rc;
++ else if (!session)
+ return ISCSI_ERR_LOGIN;
+
+ /* FIXME: login all connections! marked as "automatic" */
+@@ -1979,6 +2000,74 @@ session_login_task(node_rec_t *rec, queue_task_t *qtask)
+ return ISCSI_SUCCESS;
+ }
+
++int
++session_login_task(node_rec_t *rec, queue_task_t *qtask)
++{
++ int rc;
++
++ rc = __session_login_task(rec, qtask);
++ if (rc == ISCSI_ERR_HOST_NOT_FOUND) {
++ rc = queue_session_login_task_retry(NULL, rec, qtask);
++ if (rc)
++ return rc;
++ /*
++ * we are going to internally retry. Will return final rc
++ * when completed
++ */
++ return ISCSI_SUCCESS;
++ }
++ return rc;
++}
++
++static void session_login_task_retry(void *data)
++{
++ struct login_task_retry_info *info = data;
++ int rc;
++
++ rc = __session_login_task(info->rec, info->qtask);
++ if (rc == ISCSI_ERR_HOST_NOT_FOUND) {
++ if (info->retry_count == 5) {
++ /* give up */
++ goto write_rsp;
++ }
++
++ rc = queue_session_login_task_retry(info, info->rec,
++ info->qtask);
++ if (rc)
++ goto write_rsp;
++ /* we are going to internally retry */
++ return;
++ } else if (rc) {
++ /* hard error - no retry */
++ goto write_rsp;
++ } else
++ /* successfully started login operation */
++ goto free;
++write_rsp:
++ mgmt_ipc_write_rsp(info->qtask, rc);
++free:
++ free(info);
++}
++
++static int queue_session_login_task_retry(struct login_task_retry_info *info,
++ node_rec_t *rec, queue_task_t *qtask)
++{
++ if (!info) {
++ info = malloc(sizeof(*info));
++ if (!info)
++ return ISCSI_ERR_NOMEM;
++ memset(info, 0, sizeof(*info));
++ info->qtask = qtask;
++ info->rec = rec;
++ }
++
++ info->retry_count++;
++ log_debug(4, "queue session setup attempt in %d secs, retries %d\n",
++ 3, info->retry_count);
++ actor_timer(&info->retry_actor, 3000, session_login_task_retry, info);
++ return 0;
++}
++
+ static int
+ sync_conn(iscsi_session_t *session, uint32_t cid)
+ {
+@@ -2006,7 +2095,7 @@ iscsi_sync_session(node_rec_t *rec, queue_task_t *qtask, uint32_t sid)
+ if (!t)
+ return ISCSI_ERR_TRANS_NOT_FOUND;
+
+- session = __session_create(rec, t);
++ session = __session_create(rec, t, &err);
+ if (!session)
+ return ISCSI_ERR_LOGIN;
+
+--
+1.9.3
+
diff --git a/0078-iscsid-Fix-double-close-of-mgmt-ipc-fd.patch b/0078-iscsid-Fix-double-close-of-mgmt-ipc-fd.patch
new file mode 100644
index 0000000..aa20acf
--- /dev/null
+++ b/0078-iscsid-Fix-double-close-of-mgmt-ipc-fd.patch
@@ -0,0 +1,28 @@
+From 134f8dcbcdd76bf2418c64de1b4e3dca6163773d Mon Sep 17 00:00:00 2001
+From: Duane Northcutt <jduanen at yahoo.com>
+Date: Wed, 14 May 2014 11:23:23 -0700
+Subject: [PATCH] iscsid: Fix double close of mgmt ipc fd
+
+Ran into a problem where iscsiadm was closing an already closed fd
+(returning EBADF. Seems like the close() in line 466 is redundant as
+it is done in mgmt_ipc_destroy_queue_task(). Could also assign
+qtask->mgmt_ipc_fd to NULL, but it seems better to do it this way.
+---
+ usr/mgmt_ipc.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/usr/mgmt_ipc.c b/usr/mgmt_ipc.c
+index a82c063..ee037d9 100644
+--- a/usr/mgmt_ipc.c
++++ b/usr/mgmt_ipc.c
+@@ -463,7 +463,6 @@ mgmt_ipc_write_rsp(queue_task_t *qtask, int err)
+ qtask->rsp.err = err;
+ if (write(qtask->mgmt_ipc_fd, &qtask->rsp, sizeof(qtask->rsp)) < 0)
+ log_error("IPC qtask write failed: %s", strerror(errno));
+- close(qtask->mgmt_ipc_fd);
+ mgmt_ipc_destroy_queue_task(qtask);
+ }
+
+--
+1.9.3
+
diff --git a/0079-iscsiadm-Initialize-param_count-in-set_host_chap_inf.patch b/0079-iscsiadm-Initialize-param_count-in-set_host_chap_inf.patch
new file mode 100644
index 0000000..52dae88
--- /dev/null
+++ b/0079-iscsiadm-Initialize-param_count-in-set_host_chap_inf.patch
@@ -0,0 +1,27 @@
+From 5762ac0a9520d10e727b539403eacb7ab092e45f Mon Sep 17 00:00:00 2001
+From: Manish Rangankar <manish.rangankar at qlogic.com>
+Date: Thu, 17 Jul 2014 05:27:20 -0400
+Subject: [PATCH] iscsiadm: Initialize param_count in set_host_chap_info
+
+Signed-off-by: Manish Rangankar <manish.rangankar at qlogic.com>
+Signed-off-by: Vikas Chaudhary <vikas.chaudhary at qlogic.com>
+---
+ usr/iscsiadm.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/usr/iscsiadm.c b/usr/iscsiadm.c
+index 389f4b8..f886d39 100644
+--- a/usr/iscsiadm.c
++++ b/usr/iscsiadm.c
+@@ -1503,7 +1503,7 @@ static int set_host_chap_info(uint32_t host_no, uint64_t chap_index,
+ struct iovec *iovs = NULL;
+ struct iovec *iov = NULL;
+ int type;
+- int param_count;
++ int param_count = 0;
+ int param_used;
+ int rc = 0;
+ int fd, i = 0;
+--
+1.9.3
+
diff --git a/0081-iscsiadm-make-iface.ipaddress-optional-in-iface-conf.patch b/0081-iscsiadm-make-iface.ipaddress-optional-in-iface-conf.patch
new file mode 100644
index 0000000..cc5bd6b
--- /dev/null
+++ b/0081-iscsiadm-make-iface.ipaddress-optional-in-iface-conf.patch
@@ -0,0 +1,100 @@
+From 96eaaacaeac39625508e6ec8022bb5e565c36a7c Mon Sep 17 00:00:00 2001
+From: Anish Bhatt <anish at chelsio.com>
+Date: Fri, 25 Jul 2014 12:42:27 -0700
+Subject: [PATCH] iscsiadm : make iface.ipaddress optional in iface configs for
+ transports that don't have a hard requirement on it.
+
+v2: cxgb4i changed to NOT_REQ as set ipaddress is not supported
+Signed-off-by: Anish Bhatt <anish at chelsio.com>
+---
+ usr/initiator_common.c | 15 ++++++++++++---
+ usr/transport.c | 8 ++++----
+ usr/transport.h | 6 ++++++
+ 3 files changed, 22 insertions(+), 7 deletions(-)
+
+diff --git a/usr/initiator_common.c b/usr/initiator_common.c
+index 50f8d41..8ff993d 100644
+--- a/usr/initiator_common.c
++++ b/usr/initiator_common.c
+@@ -685,9 +685,18 @@ int iscsi_host_set_net_params(struct iface_rec *iface,
+
+ /* if we need to set the ip addr then set all the iface net settings */
+ if (!iface_is_bound_by_ipaddr(iface)) {
+- log_warning("Please set the iface.ipaddress for iface %s, "
+- "then retry the login command.\n", iface->name);
+- return EINVAL;
++ if (t->template->set_host_ip == SET_HOST_IP_REQ) {
++ log_warning("Please set the iface.ipaddress for iface "
++ "%s, then retry the login command.\n",
++ iface->name);
++ return EINVAL;
++ } else if (t->template->set_host_ip == SET_HOST_IP_OPT) {
++ log_info("Optional iface.ipaddress for iface %s "
++ "not set.\n", iface->name);
++ return 0;
++ } else {
++ return EINVAL;
++ }
+ }
+
+ /* these type of drivers need the netdev upd */
+diff --git a/usr/transport.c b/usr/transport.c
+index 2f38519..630f163 100644
+--- a/usr/transport.c
++++ b/usr/transport.c
+@@ -58,7 +58,7 @@ struct iscsi_transport_template iscsi_iser = {
+
+ struct iscsi_transport_template cxgb3i = {
+ .name = "cxgb3i",
+- .set_host_ip = 1,
++ .set_host_ip = SET_HOST_IP_OPT,
+ .ep_connect = ktransport_ep_connect,
+ .ep_poll = ktransport_ep_poll,
+ .ep_disconnect = ktransport_ep_disconnect,
+@@ -67,7 +67,7 @@ struct iscsi_transport_template cxgb3i = {
+
+ struct iscsi_transport_template cxgb4i = {
+ .name = "cxgb4i",
+- .set_host_ip = 1,
++ .set_host_ip = SET_HOST_IP_NOT_REQ,
+ .ep_connect = ktransport_ep_connect,
+ .ep_poll = ktransport_ep_poll,
+ .ep_disconnect = ktransport_ep_disconnect,
+@@ -76,7 +76,7 @@ struct iscsi_transport_template cxgb4i = {
+
+ struct iscsi_transport_template bnx2i = {
+ .name = "bnx2i",
+- .set_host_ip = 1,
++ .set_host_ip = SET_HOST_IP_REQ,
+ .use_boot_info = 1,
+ .ep_connect = ktransport_ep_connect,
+ .ep_poll = ktransport_ep_poll,
+@@ -94,7 +94,7 @@ struct iscsi_transport_template be2iscsi = {
+
+ struct iscsi_transport_template qla4xxx = {
+ .name = "qla4xxx",
+- .set_host_ip = 0,
++ .set_host_ip = SET_HOST_IP_NOT_REQ,
+ .ep_connect = ktransport_ep_connect,
+ .ep_poll = ktransport_ep_poll,
+ .ep_disconnect = ktransport_ep_disconnect,
+diff --git a/usr/transport.h b/usr/transport.h
+index 388e4b1..73041fa 100644
+--- a/usr/transport.h
++++ b/usr/transport.h
+@@ -20,6 +20,12 @@
+ #include "types.h"
+ #include "config.h"
+
++enum set_host_ip_opts {
++ SET_HOST_IP_NOT_REQ, /* iface.ipaddress is not supported */
++ SET_HOST_IP_REQ, /* iface.ipaddress must be specified */
++ SET_HOST_IP_OPT, /* iface.ipaddress is not required */
++};
++
+ struct iscsi_transport;
+ struct iscsi_conn;
+
+--
+1.9.3
+
diff --git a/0082-Remove-unused-variable-path.patch b/0082-Remove-unused-variable-path.patch
new file mode 100644
index 0000000..ed1ded1
--- /dev/null
+++ b/0082-Remove-unused-variable-path.patch
@@ -0,0 +1,33 @@
+From 21a7923de5b2f968643c2ffd96e5c9fb1b201fa3 Mon Sep 17 00:00:00 2001
+From: Hannes Reinecke <hare at suse.de>
+Date: Tue, 1 Jul 2014 11:14:26 +0200
+Subject: [PATCH] Remove unused variable 'path'
+
+Signed-off-by: Hannes Reinecke <hare at suse.de>
+---
+ usr/sysfs.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/usr/sysfs.c b/usr/sysfs.c
+index 7f31c1a..d00c925 100644
+--- a/usr/sysfs.c
++++ b/usr/sysfs.c
+@@ -671,7 +671,6 @@ int sysfs_set_param(char *id, char *subsys, char *attr_name,
+ char devpath[PATH_SIZE];
+ size_t sysfs_len;
+ char path_full[PATH_SIZE];
+- const char *path;
+ int rc = 0, fd;
+
+ if (!sysfs_lookup_devpath_by_subsys_id(devpath, sizeof(devpath),
+@@ -684,7 +683,6 @@ int sysfs_set_param(char *id, char *subsys, char *attr_name,
+ sysfs_len = strlcpy(path_full, sysfs_path, sizeof(path_full));
+ if(sysfs_len >= sizeof(path_full))
+ sysfs_len = sizeof(path_full) - 1;
+- path = &path_full[sysfs_len];
+ strlcat(path_full, devpath, sizeof(path_full));
+ strlcat(path_full, "/", sizeof(path_full));
+ strlcat(path_full, attr_name, sizeof(path_full));
+--
+1.9.3
+
diff --git a/0083-Parse-origin-value-from-iBFT.patch b/0083-Parse-origin-value-from-iBFT.patch
new file mode 100644
index 0000000..dc5a695
--- /dev/null
+++ b/0083-Parse-origin-value-from-iBFT.patch
@@ -0,0 +1,81 @@
+From 78e24f50ab754f35f4aa208ade7c9fd794d82036 Mon Sep 17 00:00:00 2001
+From: Hannes Reinecke <hare at suse.de>
+Date: Tue, 1 Jul 2014 11:14:57 +0200
+Subject: [PATCH] Parse 'origin' value from iBFT
+
+iBFT has an 'origin' field which indicates the origin of the
+network address. If that is set to '3' it indicates that
+DHCP has been used; there is no need to evaluate the 'dhcp'
+field here.
+In fact. latest iPXE sets the 'origin' field, but not the
+'dhcp' field.
+
+Signed-off-by: Hannes Reinecke <hare at suse.de>
+---
+ include/fw_context.h | 1 +
+ utils/fwparam_ibft/fw_entry.c | 8 +++++---
+ utils/fwparam_ibft/fwparam_ibft_sysfs.c | 2 ++
+ utils/fwparam_ibft/fwparam_sysfs.c | 2 ++
+ 4 files changed, 10 insertions(+), 3 deletions(-)
+
+diff --git a/include/fw_context.h b/include/fw_context.h
+index 6563d68..295b54d 100644
+--- a/include/fw_context.h
++++ b/include/fw_context.h
+@@ -48,6 +48,7 @@ struct boot_context {
+ char initiatorname[TARGET_NAME_MAXLEN + 1];
+
+ /* network settings */
++ char origin[2];
+ char dhcp[NI_MAXHOST];
+ char iface[IF_NAMESIZE];
+ char mac[18];
+diff --git a/utils/fwparam_ibft/fw_entry.c b/utils/fwparam_ibft/fw_entry.c
+index b6f05c1..295e905 100644
+--- a/utils/fwparam_ibft/fw_entry.c
++++ b/utils/fwparam_ibft/fw_entry.c
+@@ -192,10 +192,12 @@ static void dump_network(struct boot_context *context)
+ if (strlen(context->mac))
+ printf("%s = %s\n", IFACE_HWADDR, context->mac);
+ /*
+- * If this has a valid address then DHCP was used (broadcom sends
+- * 0.0.0.0).
++ * If the 'origin' field is '3' then DHCP is used.
++ * Otherwise evaluate the 'dhcp' field, if this has a valid
++ * address then DHCP was used (broadcom sends 0.0.0.0).
+ */
+- if (strlen(context->dhcp) && strcmp(context->dhcp, "0.0.0.0"))
++ if ((strlen(context->origin) && !strcmp(context->origin, "3")) ||
++ (strlen(context->dhcp) && strcmp(context->dhcp, "0.0.0.0")))
+ printf("%s = DHCP\n", IFACE_BOOT_PROTO);
+ else
+ printf("%s = STATIC\n", IFACE_BOOT_PROTO);
+diff --git a/utils/fwparam_ibft/fwparam_ibft_sysfs.c b/utils/fwparam_ibft/fwparam_ibft_sysfs.c
+index 9185c85..2dc6f6d 100644
+--- a/utils/fwparam_ibft/fwparam_ibft_sysfs.c
++++ b/utils/fwparam_ibft/fwparam_ibft_sysfs.c
+@@ -201,6 +201,8 @@ static int fill_nic_context(char *id, struct boot_context *context)
+ sizeof(context->secondary_dns));
+ sysfs_get_str(id, IBFT_SUBSYS, "dhcp", context->dhcp,
+ sizeof(context->dhcp));
++ sysfs_get_str(id, IBFT_SUBSYS, "origin", context->origin,
++ sizeof(context->origin));
+ return 0;
+ }
+
+diff --git a/utils/fwparam_ibft/fwparam_sysfs.c b/utils/fwparam_ibft/fwparam_sysfs.c
+index 2f37b59..09dd9fd 100644
+--- a/utils/fwparam_ibft/fwparam_sysfs.c
++++ b/utils/fwparam_ibft/fwparam_sysfs.c
+@@ -217,6 +217,8 @@ static int fill_nic_context(char *subsys, char *id,
+ sizeof(context->secondary_dns));
+ sysfs_get_str(id, subsys, "dhcp", context->dhcp,
+ sizeof(context->dhcp));
++ sysfs_get_str(id, subsys, "origin", context->origin,
++ sizeof(context->origin));
+ return 0;
+ }
+
+--
+1.9.3
+
diff --git a/0084-isns-Add-docs-for-deregistering-discovery-domains.patch b/0084-isns-Add-docs-for-deregistering-discovery-domains.patch
new file mode 100644
index 0000000..b5f0adc
--- /dev/null
+++ b/0084-isns-Add-docs-for-deregistering-discovery-domains.patch
@@ -0,0 +1,63 @@
+From c9d830bcd05af46df5345476a99f3086094cf44c Mon Sep 17 00:00:00 2001
+From: Lee Duncan <lduncan at suse.com>
+Date: Thu, 4 Sep 2014 10:01:53 -0700
+Subject: [PATCH] isns: Add docs for deregistering discovery domains.
+
+Without this update to the isnsadm help message and
+man page, it can be difficult to figure out how to
+deregister a registered discovery domain.
+---
+ utils/open-isns/doc/isnsadm.8 | 16 ++++++++++++++++
+ utils/open-isns/isnsadm.c | 2 ++
+ 2 files changed, 18 insertions(+)
+
+diff --git a/utils/open-isns/doc/isnsadm.8 b/utils/open-isns/doc/isnsadm.8
+index c3e2b83..88ec4cf 100644
+--- a/utils/open-isns/doc/isnsadm.8
++++ b/utils/open-isns/doc/isnsadm.8
+@@ -25,6 +25,10 @@ isnsadm \- iSNS client utility
+ .PP
+ .B isnsadm
+ .RB [ ... ]
++.RI --dd-deregister " dd-id attr=value
++.PP
++.B isnsadm
++.RB [ ... ]
+ .RI --enroll " client-name attr=value
+ .PP
+ .B isnsadm
+@@ -452,6 +456,18 @@ Note, in order to add members to an existing domain, you must
+ specify the domain's numeric ID. The domain's symbolic name
+ is not a valid handle when referring to a discovery domain.
+ .\"---------------------------
++.SS Discovery Domain Deregistration mode
++In this mode, you can deregister a discoery domain previously registered.
++Only the node which registered a discovery domain in the first place is
++permitted to remove it, or any of its members. (Control
++nodes are not bound by this restriction).
++.PP
++In Discovery Domain deregistration mode, the argument list consists of
++the Discovery Domain ID, followed by a list of
++.IB attr = value
++pairs. Discovery Domain Deregistration supports the same set of attributes as
++query mode.
++.\"---------------------------
+ .SS Client Enrollment
+ This mode only works when the server recognizes the client
+ as having control node capabilities, which is possible in
+diff --git a/utils/open-isns/isnsadm.c b/utils/open-isns/isnsadm.c
+index fadd87d..db34f8f 100644
+--- a/utils/open-isns/isnsadm.c
++++ b/utils/open-isns/isnsadm.c
+@@ -272,6 +272,8 @@ usage(int exval, const char *msg)
+ "\nThe following actions are supported:\n"
+ " --register Register one or more objects\n"
+ " --deregister Deregister an object (and children)\n"
++ " --dd-register Register a Discovery Domain (and members)\n"
++ " --dd-deregister Deregister a Discovery Domain (and members)\n"
+ " --query Query iSNS server for objects\n"
+ " --list List all objects of a given type\n"
+ " --enroll Create a new policy object for a client\n"
+--
+1.9.3
+
diff --git a/0199-use-Red-Hat-version-string-to-match-RPM-package-vers.patch b/0199-use-Red-Hat-version-string-to-match-RPM-package-vers.patch
index 1af14f0..cda6f98 100644
--- a/0199-use-Red-Hat-version-string-to-match-RPM-package-vers.patch
+++ b/0199-use-Red-Hat-version-string-to-match-RPM-package-vers.patch
@@ -16,7 +16,7 @@ index a090522..aef0c3d 100644
* some other maintainer could merge a patch without going through us
*/
-#define ISCSI_VERSION_STR "2.0-873"
-+#define ISCSI_VERSION_STR "6.2.0.873-21"
++#define ISCSI_VERSION_STR "6.2.0.873-22"
#define ISCSI_VERSION_FILE "/sys/module/scsi_transport_iscsi/version"
#endif
diff --git a/iscsi-initiator-utils.spec b/iscsi-initiator-utils.spec
index be98cd6..ac3cf43 100644
--- a/iscsi-initiator-utils.spec
+++ b/iscsi-initiator-utils.spec
@@ -4,7 +4,7 @@
Summary: iSCSI daemon and utility programs
Name: iscsi-initiator-utils
Version: 6.%{open_iscsi_version}.%{open_iscsi_build}
-Release: 21%{?dist}
+Release: 22%{?dist}
Group: System Environment/Daemons
License: GPLv2+
URL: http://www.open-iscsi.org
@@ -81,10 +81,20 @@ Patch64: 0064-ISCSIUIO-Removed-the-auto-generated-COPYING-file.patch
Patch68: 0068-iscsiuio-fix-compilation.patch
Patch69: 0069-Add-missing-DESTDIR.patch
Patch70: 0070-iscsi-tools-set-non-negotiated-params-early.patch
+Patch71: 0071-iscsiadm-Fix-the-hostno-check-for-stats-submode-of-h.patch
+Patch72: 0072-iscsiadm-Fix-the-compile-time-warning.patch
+Patch74: 0074-iscsid-Fix-handling-of-iscsi-async-events.patch
+Patch75: 0075-be2iscsi-Fix-MaxXmitDataLenght-of-the-driver.patch
+Patch76: 0076-Fix-StatSN-in-Open-iSCSI-Stack.patch
+Patch77: 0077-iscsid-retry-login-for-ISCSI_ERR_HOST_NOT_FOUND.patch
+Patch78: 0078-iscsid-Fix-double-close-of-mgmt-ipc-fd.patch
+Patch79: 0079-iscsiadm-Initialize-param_count-in-set_host_chap_inf.patch
+Patch81: 0081-iscsiadm-make-iface.ipaddress-optional-in-iface-conf.patch
+Patch82: 0082-Remove-unused-variable-path.patch
+Patch83: 0083-Parse-origin-value-from-iBFT.patch
+Patch84: 0084-isns-Add-docs-for-deregistering-discovery-domains.patch
# not (yet) upstream merged
-Patch131: 0131-iscsiadm-Fix-the-hostno-check-for-stats-submode-of-h.patch
-Patch132: 0132-iscsiadm-Fix-the-compile-time-warning.patch
Patch143: 0143-idmb_rec_write-check-for-tpgt-first.patch
Patch145: 0145-idbm_rec_write-seperate-old-and-new-style-writes.patch
Patch146: 0146-idbw_rec_write-pick-tpgt-from-existing-record.patch
@@ -217,9 +227,19 @@ developing applications that use %{name}.
%patch68 -p1
%patch69 -p1
%patch70 -p1
+%patch71 -p1
+%patch72 -p1
+%patch74 -p1
+%patch75 -p1
+%patch76 -p1
+%patch77 -p1
+%patch78 -p1
+%patch79 -p1
+%patch81 -p1
+%patch82 -p1
+%patch83 -p1
+%patch84 -p1
# pending upstream merge
-%patch131 -p1
-%patch132 -p1
%patch143 -p1
%patch145 -p1
%patch146 -p1
@@ -403,6 +423,10 @@ fi
%{_includedir}/libiscsi.h
%changelog
+* Wed Sep 24 2014 Chris Leech <cleech at redhat.com> - 6.2.0.873-22
+- 1081798 retry login on host not found error
+- sync with upstream
+
* Tue Mar 18 2014 Chris Leech <cleech at redhat.com> - 6.2.0.873-21
- 1069825
- boot session handling improvements
More information about the scm-commits
mailing list