[iscsi-initiator-utils: 24/109] fix several multi transport running bugs
Chris Leech
cleech at fedoraproject.org
Tue Dec 10 21:21:23 UTC 2013
commit cd17de22ed89435e86ede857322fa9d75ef0a1ab
Author: mchristi <mchristi at redhat.com>
Date: Fri Sep 15 20:39:14 2006 +0000
fix several multi transport running bugs
.cvsignore | 1 +
...tiator-utils-fix-session-mixup-on-restart.patch | 113 ++++++++++++++++++++
iscsi-initiator-utils.spec | 11 ++-
sources | 2 +-
4 files changed, 124 insertions(+), 3 deletions(-)
---
diff --git a/.cvsignore b/.cvsignore
index 6d98627..7c5078e 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -5,3 +5,4 @@ open-iscsi-6.0.5.595.tar.bz2
open-iscsi-1.1-645.tar.bz2
open-iscsi-6.1.1.645.tar.bz2
open-iscsi-6.1.1.685.tar.bz2
+open-iscsi-6.2.0.695.tar.bz2
diff --git a/iscsi-initiator-utils-fix-session-mixup-on-restart.patch b/iscsi-initiator-utils-fix-session-mixup-on-restart.patch
new file mode 100644
index 0000000..89233a2
--- /dev/null
+++ b/iscsi-initiator-utils-fix-session-mixup-on-restart.patch
@@ -0,0 +1,113 @@
+diff -aurp open-iscsi-6.2.0.695/usr/initiator.c open-iscsi-6.2.0.695.qla4xxx/usr/initiator.c
+--- open-iscsi-6.2.0.695/usr/initiator.c 2006-09-06 16:22:44.000000000 -0500
++++ open-iscsi-6.2.0.695.qla4xxx/usr/initiator.c 2006-09-15 15:16:57.000000000 -0500
+@@ -1524,11 +1524,17 @@ static int match_session(void *data, cha
+ int port, int sid)
+ {
+ node_rec_t *rec = data;
++ iscsi_provider_t *p;
+
+- log_debug(6, "looking for session [%s,%s,%d]",
++ log_debug(6, "looking for session [%d][%s,%s,%d]", sid,
+ rec->name, rec->conn[0].address, rec->conn[0].port);
+
+- if (!strncmp(rec->name, targetname, strlen(rec->name)) &&
++ p = get_transport_by_sid(sid);
++ if (!p)
++ return 0;
++
++ if (!strcmp(rec->transport_name, p->name) &&
++ !strncmp(rec->name, targetname, strlen(rec->name)) &&
+ !strncmp(rec->conn[0].address, address,
+ strlen(rec->conn[0].address)) &&
+ rec->conn[0].port == port)
+@@ -1555,7 +1561,8 @@ session_find_by_rec(node_rec_t *rec)
+
+ if (match_session(rec, session->nrec.name,
+ -1, session->nrec.conn[0].address,
+- session->nrec.conn[0].port, -1))
++ session->nrec.conn[0].port,
++ session->id))
+ return session;
+
+ sitem = sitem->q_forw;
+diff -aurp open-iscsi-6.2.0.695/usr/iscsid.c open-iscsi-6.2.0.695.qla4xxx/usr/iscsid.c
+--- open-iscsi-6.2.0.695/usr/iscsid.c 2006-09-06 02:16:07.000000000 -0500
++++ open-iscsi-6.2.0.695.qla4xxx/usr/iscsid.c 2006-09-15 15:08:59.000000000 -0500
+@@ -97,20 +97,28 @@ static int sync_session(void *data, char
+ int fd = -1;
+ iscsiadm_req_t req;
+ iscsiadm_rsp_t rsp;
++ iscsi_provider_t *p;
+
+ log_debug(7, "sync session [%d][%s,%s.%d]\n", sid, targetname, address,
+ port);
+
+- /* for now skip qlogic and other HW and offload drivers */
+- if (!get_transport_by_sid(sid))
++ p = get_transport_by_sid(sid);
++ if (!p)
+ return 0;
+
+ if (idbm_node_read(db, &rec, targetname, address, port)) {
+- log_error("could not read data for [%s,%s.%d]\n",
+- targetname, address, port);
++ log_warning("could not read data for [%s,%s.%d]\n",
++ targetname, address, port);
+ return 0;
+ }
+
++ /*
++ * for now skip qlogic and other HW and offload driver that
++ * that store their data somewhere else
++ */
++ if (strcmp(p->name, rec.transport_name))
++ return 0;
++
+ memset(&req, 0, sizeof(req));
+ req.command = MGMT_IPC_SESSION_SYNC;
+ req.u.session.sid = sid;
+diff -aurp open-iscsi-6.2.0.695/usr/iscsi_sysfs.c open-iscsi-6.2.0.695.qla4xxx/usr/iscsi_sysfs.c
+--- open-iscsi-6.2.0.695/usr/iscsi_sysfs.c 2006-09-06 16:22:44.000000000 -0500
++++ open-iscsi-6.2.0.695.qla4xxx/usr/iscsi_sysfs.c 2006-09-15 14:52:14.000000000 -0500
+@@ -164,16 +164,36 @@ int get_sessioninfo_by_sysfs_id(int *sid
+ "persistent_address", *sid);
+ memset(addr, 0, NI_MAXHOST);
+ ret = read_sysfs_file(sysfs_file, addr, "%s\n");
+- if (ret)
+- log_debug(5, "could not read conn addr: %d", ret);
++ if (ret) {
++ /* fall back to current address */
++ log_debug(5, "could not read pers conn addr: %d", ret);
++ memset(sysfs_file, 0, PATH_MAX);
++ sprintf(sysfs_file,
++ "/sys/class/iscsi_connection/connection%d:0/address",
++ *sid);
++ memset(addr, 0, NI_MAXHOST);
++ ret = read_sysfs_file(sysfs_file, addr, "%s\n");
++ if (ret)
++ log_debug(5, "could not read curr addr: %d", ret);
++ }
+
+ memset(sysfs_file, 0, PATH_MAX);
+ sprintf(sysfs_file, "/sys/class/iscsi_connection/connection%d:0/"
+ "persistent_port", *sid);
+ *port = -1;
+ ret = read_sysfs_file(sysfs_file, port, "%u\n");
+- if (ret)
+- log_debug(5, "Could not read conn port %d\n", ret);
++ if (ret) {
++ /* fall back to current port */
++ log_debug(5, "Could not read pers conn port %d\n", ret);
++ memset(sysfs_file, 0, PATH_MAX);
++ sprintf(sysfs_file,
++ "/sys/class/iscsi_connection/connection%d:0/port",
++ *sid);
++ *port = -1;
++ ret = read_sysfs_file(sysfs_file, port, "%u\n");
++ if (ret)
++ log_debug(5, "Could not read curr conn port %d\n", ret);
++ }
+
+ log_debug(7, "found targetname %s address %s port %d\n",
+ targetname, addr ? addr : "NA", *port);
diff --git a/iscsi-initiator-utils.spec b/iscsi-initiator-utils.spec
index dfc349e..3d243bc 100644
--- a/iscsi-initiator-utils.spec
+++ b/iscsi-initiator-utils.spec
@@ -1,11 +1,12 @@
Summary: iSCSI daemon and utility programs
Name: iscsi-initiator-utils
-Version: 6.1.1.685
+Version: 6.2.0.695
Release: 0.1
-Source0: http://people.redhat.com/mchristi/iscsi/FC6/open-iscsi/rpm/open-iscsi-6.1.1.685.tar.bz2
+Source0: http://people.redhat.com/mchristi/iscsi/FC6/open-iscsi/rpm/open-iscsi-6.2.0.695.tar.bz2
Source1: iscsi.init
Patch0: open-iscsi-5.0.5.595-update-initscripts-and-docs.patch
Patch1: open-iscsi-5.0.5.595-add-iscsi-iname.patch
+Patch2: iscsi-initiator-utils-fix-session-mixup-on-restart.patch
Group: System Environment/Daemons
License: GPL
@@ -25,6 +26,7 @@ Protocol networks.
%setup -q -n open-iscsi-%{version}
%patch0 -p1 -b .update-initscripts-and-docs
%patch1 -p1 -b .add-iscsi-iname
+%patch2 -p1 -b .fix-session-mixup-on-restart
%build
make OPTFLAGS="%{optflags}" -C usr
@@ -67,6 +69,11 @@ fi
%{_mandir}/*/*
%changelog
+* Fri Sep 15 2006 Mike Christie <mchristie at redhat.com> - 6.2.0.695-0.1
+- Add compat with FC kernel so iscsid will pass startup checks and run.
+- Fix bug when using hw iscsi and software iscsi and iscsid is restarted.
+- Fix session matching bug when hw and software iscsi is both running
+
* Tue Sep 5 2006 Jeremy Katz <katzj at redhat.com> - 6.1.1.685-0.1
- Fix service startup
- Fix another case where cflags weren't being used
diff --git a/sources b/sources
index e657394..4b5f795 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-89a822f2b1a06884f915e6512df3a384 open-iscsi-6.1.1.685.tar.bz2
+01b98ae5349609977c795cc039cd33d3 open-iscsi-6.2.0.695.tar.bz2
More information about the scm-commits
mailing list