From 0047874487fd0e71129f2a681ee2c9f3697a5957 Mon Sep 17 00:00:00 2001 From: Chris Leech Date: Mon, 17 Nov 2014 22:10:40 -0800 Subject: [PATCH 1/5] segfault from unexpected netlink event during discovery Resolves: #1040343 --- ...LL-ptr-during-discovery-from-unexpec.patch | 34 +++++++++++++++++++ 0171-iscsiuio-strict-aliasing.patch | 26 ++++++++++++++ ...ion-string-to-match-RPM-package-vers.patch | 2 +- iscsi-initiator-utils.spec | 10 +++++- 4 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 0130-guard-against-NULL-ptr-during-discovery-from-unexpec.patch create mode 100644 0171-iscsiuio-strict-aliasing.patch diff --git a/0130-guard-against-NULL-ptr-during-discovery-from-unexpec.patch b/0130-guard-against-NULL-ptr-during-discovery-from-unexpec.patch new file mode 100644 index 0000000..fb9d7ec --- /dev/null +++ b/0130-guard-against-NULL-ptr-during-discovery-from-unexpec.patch @@ -0,0 +1,34 @@ +From 46bc7ff0091af95735c03995be7d6002b03944dd Mon Sep 17 00:00:00 2001 +From: Chris Leech +Date: Mon, 17 Nov 2014 21:34:06 -0800 +Subject: [PATCH] guard against NULL ptr during discovery from unexpected event + +When demand loading drivers during discovery, iscsiadm can receive an +unexpected netlink event, like a link up, when looking for a discovery +session login status. That could expose krecv_conn_state to a +connection without a valid recv_context pointer. +Guard against that to prevent the NULL dereference. + +Signed-off-by: Chris Leech +--- + usr/netlink.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/usr/netlink.c b/usr/netlink.c +index 1c4b5cc..18be5e5 100644 +--- a/usr/netlink.c ++++ b/usr/netlink.c +@@ -1035,6 +1035,10 @@ static int krecv_conn_state(struct iscsi_conn *conn, uint32_t *state) + /* fatal handling error or conn error */ + goto exit; + ++ /* unexpected event without a receive context */ ++ if (!conn->recv_context) ++ return -EAGAIN; ++ + *state = *(enum iscsi_conn_state *)conn->recv_context->data; + + ipc_ev_clbk->put_ev_context(conn->recv_context); +-- +1.9.3 + diff --git a/0171-iscsiuio-strict-aliasing.patch b/0171-iscsiuio-strict-aliasing.patch new file mode 100644 index 0000000..1a0eb68 --- /dev/null +++ b/0171-iscsiuio-strict-aliasing.patch @@ -0,0 +1,26 @@ +diff --git a/iscsiuio/configure b/iscsiuio/configure +index 50cfd90..c930b67 100755 +--- a/iscsiuio/configure ++++ b/iscsiuio/configure +@@ -22782,7 +22782,7 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + +-CFLAGS="${CFLAGS} -O2 -Wall" ++CFLAGS="${CFLAGS} -O2 -Wall -fno-strict-aliasing" + ## check for --enable-debug first before checking CFLAGS before + ## so that we don't mix -O and -g + # Check whether --enable-debug was given. +diff --git a/iscsiuio/configure.ac b/iscsiuio/configure.ac +index e4af3b2..551a513 100644 +--- a/iscsiuio/configure.ac ++++ b/iscsiuio/configure.ac +@@ -52,7 +52,7 @@ AC_LIBTOOL_DLOPEN + # libtool stuff + AC_PROG_LIBTOOL + +-CFLAGS="${CFLAGS} -O2 -Wall" ++CFLAGS="${CFLAGS} -O2 -Wall -fno-strict-aliasing" + ## check for --enable-debug first before checking CFLAGS before + ## so that we don't mix -O and -g + AC_ARG_ENABLE(debug, 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 cda6f98..747c9da 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-22" ++#define ISCSI_VERSION_STR "6.2.0.873-24" #define ISCSI_VERSION_FILE "/sys/module/scsi_transport_iscsi/version" #endif diff --git a/iscsi-initiator-utils.spec b/iscsi-initiator-utils.spec index e1f665d..8308b74 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: 23%{?dist} +Release: 24%{?dist} Group: System Environment/Daemons License: GPLv2+ URL: http://www.open-iscsi.org @@ -95,6 +95,7 @@ Patch83: 0083-Parse-origin-value-from-iBFT.patch Patch84: 0084-isns-Add-docs-for-deregistering-discovery-domains.patch # not (yet) upstream merged +Patch130: 0130-guard-against-NULL-ptr-during-discovery-from-unexpec.patch Patch140: 0140-add-discovery-as-a-valid-mode-in-iscsiadm.8.patch Patch143: 0143-idmb_rec_write-check-for-tpgt-first.patch Patch145: 0145-idbm_rec_write-seperate-old-and-new-style-writes.patch @@ -121,6 +122,7 @@ Patch167: 0167-Revert-iscsiadm-return-error-when-login-fails.patch Patch168: 0168-update-handling-of-boot-sessions.patch Patch169: 0169-update-iscsi.service-for-boot-session-recovery.patch Patch170: 0170-fix-systemd-unit-wants.patch +Patch171: 0171-iscsiuio-strict-aliasing.patch # version string, needs to be updated with each build Patch199: 0199-use-Red-Hat-version-string-to-match-RPM-package-vers.patch @@ -242,6 +244,7 @@ developing applications that use %{name}. %patch83 -p1 %patch84 -p1 # pending upstream merge +%patch130 -p1 %patch140 -p1 %patch143 -p1 %patch145 -p1 @@ -268,6 +271,7 @@ developing applications that use %{name}. %patch168 -p1 %patch169 -p1 %patch170 -p1 +%patch171 -p1 # version string %patch199 -p1 @@ -448,6 +452,10 @@ fi %{_includedir}/libiscsi.h %changelog +* Tue Nov 18 2014 Chris Leech - 6.2.0.873-24 +- 1040343 segfault from unexpected netlink event during discovery +- inhibit strict aliasing optimizations in iscsiuio, rpmdiff error + * Tue Oct 21 2014 Chris Leech - 6.2.0.873-23 - make sure to pass --with-security=no to isns configure (#1088020) From 0ed757e32c57cf4e8fc595e82eaf929019f5667d Mon Sep 17 00:00:00 2001 From: Andy Grover Date: Thu, 11 Dec 2014 12:16:30 -0800 Subject: [PATCH 2/5] Also pass --with-slp=no to open-isns configure Resolves: #1088020 --- iscsi-initiator-utils.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/iscsi-initiator-utils.spec b/iscsi-initiator-utils.spec index 8308b74..7e3da6b 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: 24%{?dist} +Release: 25%{?dist} Group: System Environment/Daemons License: GPLv2+ URL: http://www.open-iscsi.org @@ -287,7 +287,7 @@ cd iscsiuio %{configure} cd .. cd utils/open-isns -%{configure} --with-security=no +%{configure} --with-security=no --with-slp=no cd ../.. %{__make} OPTFLAGS="%{optflags} %{?__global_ldflags} -DUSE_KMOD -lkmod" @@ -452,6 +452,9 @@ fi %{_includedir}/libiscsi.h %changelog +* Thu Dec 11 2014 Andy Grover - 6.2.0.873-25 +- Add --with-slp=no for #1088020 + * Tue Nov 18 2014 Chris Leech - 6.2.0.873-24 - 1040343 segfault from unexpected netlink event during discovery - inhibit strict aliasing optimizations in iscsiuio, rpmdiff error From 0fab0a74135d23b48d16a4076381439d744a7b66 Mon Sep 17 00:00:00 2001 From: Chris Leech Date: Tue, 13 Jan 2015 19:19:38 -0800 Subject: [PATCH 3/5] created iscsi-shutdown.service to ensure that session cleanup happens Resolves: #1166713 --- 0172-move-cleanup-to-seperate-service.patch | 55 +++++++++++++++++++ ...ion-string-to-match-RPM-package-vers.patch | 2 +- iscsi-initiator-utils.spec | 18 +++++- 3 files changed, 71 insertions(+), 4 deletions(-) create mode 100644 0172-move-cleanup-to-seperate-service.patch diff --git a/0172-move-cleanup-to-seperate-service.patch b/0172-move-cleanup-to-seperate-service.patch new file mode 100644 index 0000000..c7193ba --- /dev/null +++ b/0172-move-cleanup-to-seperate-service.patch @@ -0,0 +1,55 @@ +From 56d9d1c6a02dcad0915c0673f9cd2e653c86302f Mon Sep 17 00:00:00 2001 +From: rpm-build +Date: Tue, 13 Jan 2015 16:30:01 -0800 +Subject: [PATCH] 0171-make-session-shutdown-a-seperate-service.patch + +--- + etc/systemd/iscsi-shutdown.service | 14 ++++++++++++++ + etc/systemd/iscsi.service | 3 +-- + 2 files changed, 15 insertions(+), 2 deletions(-) + create mode 100644 etc/systemd/iscsi-shutdown.service + +diff --git a/etc/systemd/iscsi-shutdown.service b/etc/systemd/iscsi-shutdown.service +new file mode 100644 +index 0000000..23758e9 +--- /dev/null ++++ b/etc/systemd/iscsi-shutdown.service +@@ -0,0 +1,14 @@ ++[Unit] ++Description=Logout off all iSCSI sessions on shutdown ++Documentation=man:iscsid(8) man:iscsiadm(8) ++DefaultDependencies=no ++Conflicts=shutdown.target ++After=systemd-remount-fs.service network.target iscsid.service iscsiuio.service ++Before=remote-fs-pre.target ++Wants=remote-fs-pre.target ++RefuseManualStop=yes ++ ++[Service] ++Type=oneshot ++RemainAfterExit=true ++ExecStop=-/sbin/iscsiadm -m node --logoutall=all +diff --git a/etc/systemd/iscsi.service b/etc/systemd/iscsi.service +index ad7be34..2736956 100644 +--- a/etc/systemd/iscsi.service ++++ b/etc/systemd/iscsi.service +@@ -5,7 +5,7 @@ DefaultDependencies=no + Conflicts=shutdown.target + After=systemd-remount-fs.service network.target iscsid.service iscsiuio.service + Before=remote-fs-pre.target +-Wants=remote-fs-pre.target ++Wants=remote-fs-pre.target iscsi-shutdown.service + ConditionDirectoryNotEmpty=|/var/lib/iscsi/nodes + ConditionDirectoryNotEmpty=|/sys/class/iscsi_session + +@@ -14,7 +14,6 @@ Type=oneshot + RemainAfterExit=true + ExecStart=-/usr/libexec/iscsi-mark-root-nodes + ExecStart=-/sbin/iscsiadm -m node --loginall=automatic +-ExecStop=-/sbin/iscsiadm -m node --logoutall=automatic + ExecReload=-/sbin/iscsiadm -m node --loginall=automatic + + [Install] +-- +2.1.0 + 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 747c9da..2da25e9 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-24" ++#define ISCSI_VERSION_STR "6.2.0.873-26" #define ISCSI_VERSION_FILE "/sys/module/scsi_transport_iscsi/version" #endif diff --git a/iscsi-initiator-utils.spec b/iscsi-initiator-utils.spec index 7e3da6b..44d0240 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: 25%{?dist} +Release: 26%{?dist} Group: System Environment/Daemons License: GPLv2+ URL: http://www.open-iscsi.org @@ -123,6 +123,7 @@ Patch168: 0168-update-handling-of-boot-sessions.patch Patch169: 0169-update-iscsi.service-for-boot-session-recovery.patch Patch170: 0170-fix-systemd-unit-wants.patch Patch171: 0171-iscsiuio-strict-aliasing.patch +Patch172: 0172-move-cleanup-to-seperate-service.patch # version string, needs to be updated with each build Patch199: 0199-use-Red-Hat-version-string-to-match-RPM-package-vers.patch @@ -272,6 +273,7 @@ developing applications that use %{name}. %patch169 -p1 %patch170 -p1 %patch171 -p1 +%patch172 -p1 # version string %patch199 -p1 @@ -323,6 +325,7 @@ touch $RPM_BUILD_ROOT/var/lock/iscsi/lock %{__install} -d $RPM_BUILD_ROOT%{_unitdir} %{__install} -pm 644 etc/systemd/iscsi.service $RPM_BUILD_ROOT%{_unitdir} +%{__install} -pm 644 etc/systemd/iscsi-shutdown.service $RPM_BUILD_ROOT%{_unitdir} %{__install} -pm 644 etc/systemd/iscsid.service $RPM_BUILD_ROOT%{_unitdir} %{__install} -pm 644 etc/systemd/iscsid.socket $RPM_BUILD_ROOT%{_unitdir} %{__install} -pm 644 etc/systemd/iscsiuio.service $RPM_BUILD_ROOT%{_unitdir} @@ -351,7 +354,7 @@ touch $RPM_BUILD_ROOT/var/lock/iscsi/lock %post /sbin/ldconfig -%systemd_post iscsi.service iscsid.service iscsiuio.service iscsid.socket iscsiuio.socket +%systemd_post iscsi.service iscsi-shutdown.service iscsid.service iscsiuio.service iscsid.socket iscsiuio.socket if [ $1 -eq 1 ]; then if [ ! -f %{_sysconfdir}/iscsi/initiatorname.iscsi ]; then @@ -364,7 +367,7 @@ if [ $1 -eq 1 ]; then fi %preun -%systemd_preun iscsi.service iscsid.service iscsiuio.service iscsid.socket iscsiuio.socket +%systemd_preun iscsi.service iscsi-shutdown.service iscsid.service iscsiuio.service iscsid.socket iscsiuio.socket %postun /sbin/ldconfig @@ -409,6 +412,11 @@ if [ $1 -gt 0 ]; then fi fi +%triggerun -- iscsi-initiator-utils < 6.2.0.873-26 +if [ $1 -gt 0 ]; then + systemctl start iscsi-shutdown.service +fi + %files %doc README %dir %{_sharedstatedir}/iscsi @@ -421,6 +429,7 @@ fi %ghost %{_var}/lock/iscsi %ghost %{_var}/lock/iscsi/lock %{_unitdir}/iscsi.service +%{_unitdir}/iscsi-shutdown.service %{_unitdir}/iscsid.service %{_unitdir}/iscsid.socket %{_libexecdir}/iscsi-mark-root-nodes @@ -452,6 +461,9 @@ fi %{_includedir}/libiscsi.h %changelog +* Mon Jan 12 2015 Chris Leech - 6.2.0.873-26 +- 1166713 created iscsi-shutdown.service to ensure that session cleanup happens + * Thu Dec 11 2014 Andy Grover - 6.2.0.873-25 - Add --with-slp=no for #1088020 From 705c811a7caabe7fa4f23b319cfad0481e97ac16 Mon Sep 17 00:00:00 2001 From: Chris Leech Date: Thu, 15 Jan 2015 10:19:41 -0800 Subject: [PATCH 4/5] fix regression in network interface binding Resolves: #1168556 --- ...egression-in-iscsi_tcp-iface-binding.patch | 129 ++++++++++++++++++ ...ion-string-to-match-RPM-package-vers.patch | 2 +- iscsi-initiator-utils.spec | 13 +- 3 files changed, 139 insertions(+), 5 deletions(-) create mode 100644 0114-fix-regression-in-iscsi_tcp-iface-binding.patch diff --git a/0114-fix-regression-in-iscsi_tcp-iface-binding.patch b/0114-fix-regression-in-iscsi_tcp-iface-binding.patch new file mode 100644 index 0000000..ff4da71 --- /dev/null +++ b/0114-fix-regression-in-iscsi_tcp-iface-binding.patch @@ -0,0 +1,129 @@ +From 2966a9262df88fcfa971f988f93a9bf168600331 Mon Sep 17 00:00:00 2001 +From: Chris Leech +Date: Sun, 11 Jan 2015 21:36:24 -0800 +Subject: [PATCH] fix regression in iscsi_tcp iface binding + +The changes in "retry login for ISCSI_ERR_HOST_NOT_FOUND" caused +sessions using the iscsi_tcp transport bound to a network iface to fail +to connect due to the host lookup failing (iscsi_tcp hosts are +dynamically allocated per-session). + +This marks transports that use a host fixed to a hardware offload device +with "bind_ep_required" and only requires a host lookup before starting +the connection if this flag is set. + +Signed-off-by: Chris Leech +--- + usr/initiator.c | 30 ++++++++++++++++-------------- + usr/transport.c | 6 ++++++ + usr/transport.h | 1 + + 3 files changed, 23 insertions(+), 14 deletions(-) + +diff --git a/usr/initiator.c b/usr/initiator.c +index f54b708..1aadc9b 100644 +--- a/usr/initiator.c ++++ b/usr/initiator.c +@@ -398,20 +398,22 @@ __session_create(node_rec_t *rec, struct iscsi_transport *t, int *rc) + + iscsi_session_init_params(session); + +- 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 +- * if offload is used. +- */ +- session->conn[0].bind_ep = 1; +- session->hostno = hostno; +- } else if (*rc == ISCSI_ERR_HOST_NOT_FOUND) { +- goto free_session; +- } else { +- *rc = 0; +- } ++ if (t->template->bind_ep_required) { ++ 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 ++ * if offload is used. ++ */ ++ 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; +diff --git a/usr/transport.c b/usr/transport.c +index 630f163..e778a6e 100644 +--- a/usr/transport.c ++++ b/usr/transport.c +@@ -59,6 +59,7 @@ struct iscsi_transport_template iscsi_iser = { + struct iscsi_transport_template cxgb3i = { + .name = "cxgb3i", + .set_host_ip = SET_HOST_IP_OPT, ++ .bind_ep_required = 1, + .ep_connect = ktransport_ep_connect, + .ep_poll = ktransport_ep_poll, + .ep_disconnect = ktransport_ep_disconnect, +@@ -68,6 +69,7 @@ struct iscsi_transport_template cxgb3i = { + struct iscsi_transport_template cxgb4i = { + .name = "cxgb4i", + .set_host_ip = SET_HOST_IP_NOT_REQ, ++ .bind_ep_required = 1, + .ep_connect = ktransport_ep_connect, + .ep_poll = ktransport_ep_poll, + .ep_disconnect = ktransport_ep_disconnect, +@@ -78,6 +80,7 @@ struct iscsi_transport_template bnx2i = { + .name = "bnx2i", + .set_host_ip = SET_HOST_IP_REQ, + .use_boot_info = 1, ++ .bind_ep_required = 1, + .ep_connect = ktransport_ep_connect, + .ep_poll = ktransport_ep_poll, + .ep_disconnect = ktransport_ep_disconnect, +@@ -86,6 +89,7 @@ struct iscsi_transport_template bnx2i = { + + struct iscsi_transport_template be2iscsi = { + .name = "be2iscsi", ++ .bind_ep_required = 1, + .create_conn = be2iscsi_create_conn, + .ep_connect = ktransport_ep_connect, + .ep_poll = ktransport_ep_poll, +@@ -95,6 +99,7 @@ struct iscsi_transport_template be2iscsi = { + struct iscsi_transport_template qla4xxx = { + .name = "qla4xxx", + .set_host_ip = SET_HOST_IP_NOT_REQ, ++ .bind_ep_required = 1, + .ep_connect = ktransport_ep_connect, + .ep_poll = ktransport_ep_poll, + .ep_disconnect = ktransport_ep_disconnect, +@@ -102,6 +107,7 @@ struct iscsi_transport_template qla4xxx = { + + struct iscsi_transport_template ocs = { + .name = "ocs", ++ .bind_ep_required = 1, + .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 73041fa..831403b 100644 +--- a/usr/transport.h ++++ b/usr/transport.h +@@ -38,6 +38,7 @@ struct iscsi_transport_template { + */ + uint8_t set_host_ip; + uint8_t use_boot_info; ++ uint8_t bind_ep_required; + int (*ep_connect) (struct iscsi_conn *conn, int non_blocking); + int (*ep_poll) (struct iscsi_conn *conn, int timeout_ms); + void (*ep_disconnect) (struct iscsi_conn *conn); +-- +2.1.0 + 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 2da25e9..2956d4c 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-26" ++#define ISCSI_VERSION_STR "6.2.0.873-27" #define ISCSI_VERSION_FILE "/sys/module/scsi_transport_iscsi/version" #endif diff --git a/iscsi-initiator-utils.spec b/iscsi-initiator-utils.spec index 44d0240..3467d96 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: 26%{?dist} +Release: 27%{?dist} Group: System Environment/Daemons License: GPLv2+ URL: http://www.open-iscsi.org @@ -93,6 +93,7 @@ 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 +Patch114: 0114-fix-regression-in-iscsi_tcp-iface-binding.patch # not (yet) upstream merged Patch130: 0130-guard-against-NULL-ptr-during-discovery-from-unexpec.patch @@ -244,6 +245,7 @@ developing applications that use %{name}. %patch82 -p1 %patch83 -p1 %patch84 -p1 +%patch114 -p1 # pending upstream merge %patch130 -p1 %patch140 -p1 @@ -406,15 +408,15 @@ if [ $1 -gt 0 ]; then cp $SRC $DST fi sed -i 's/RefuseManualStart=yes/RefuseManualStart=no/' $DST - /usr/bin/systemctl daemon-reload - /usr/bin/systemctl start remote-fs-pre.target + /usr/bin/systemctl daemon-reload >/dev/null 2>&1 || : + /usr/bin/systemctl start remote-fs-pre.target >/dev/null 2>&1 || : fi fi fi %triggerun -- iscsi-initiator-utils < 6.2.0.873-26 if [ $1 -gt 0 ]; then - systemctl start iscsi-shutdown.service + systemctl start iscsi-shutdown.service >/dev/null 2>&1 || : fi %files @@ -461,6 +463,9 @@ fi %{_includedir}/libiscsi.h %changelog +* Thu Jan 15 2015 Chris Leech - 6.2.0.873-27 +- 1168556 fix regression in network interface binding + * Mon Jan 12 2015 Chris Leech - 6.2.0.873-26 - 1166713 created iscsi-shutdown.service to ensure that session cleanup happens From 6ac03dbfba543b190d26d8bfee08fe5dffe52df9 Mon Sep 17 00:00:00 2001 From: Chris Leech Date: Thu, 15 Jan 2015 21:19:27 -0800 Subject: [PATCH 5/5] Resolves: #1180100 scriptlets were never split out properly for the iscsiuio subpackage --- ...ion-string-to-match-RPM-package-vers.patch | 2 +- iscsi-initiator-utils.spec | 23 +++++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) 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 2956d4c..c222d9d 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-27" ++#define ISCSI_VERSION_STR "6.2.0.873-28" #define ISCSI_VERSION_FILE "/sys/module/scsi_transport_iscsi/version" #endif diff --git a/iscsi-initiator-utils.spec b/iscsi-initiator-utils.spec index 3467d96..c129c4d 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: 27%{?dist} +Release: 28%{?dist} Group: System Environment/Daemons License: GPLv2+ URL: http://www.open-iscsi.org @@ -356,7 +356,7 @@ touch $RPM_BUILD_ROOT/var/lock/iscsi/lock %post /sbin/ldconfig -%systemd_post iscsi.service iscsi-shutdown.service iscsid.service iscsiuio.service iscsid.socket iscsiuio.socket +%systemd_post iscsi.service iscsi-shutdown.service iscsid.service iscsid.socket if [ $1 -eq 1 ]; then if [ ! -f %{_sysconfdir}/iscsi/initiatorname.iscsi ]; then @@ -365,16 +365,28 @@ if [ $1 -eq 1 ]; then # enable socket activation and persistant session startup by default /bin/systemctl enable iscsi.service >/dev/null 2>&1 || : /bin/systemctl enable iscsid.socket >/dev/null 2>&1 || : +fi + +%post iscsiuio +%systemd_post iscsiuio.service iscsiuio.socket + +if [ $1 -eq 1 ]; then /bin/systemctl enable iscsiuio.socket >/dev/null 2>&1 || : fi %preun %systemd_preun iscsi.service iscsi-shutdown.service iscsid.service iscsiuio.service iscsid.socket iscsiuio.socket +%preun iscsiuio +%systemd_preun iscsiuio.service iscsiuio.socket + %postun /sbin/ldconfig %systemd_postun +%postun iscsiuio +%systemd_postun + %triggerun -- iscsi-initiator-utils < 6.2.0.873-1 # Save the current service runlevel info # User must manually run systemd-sysv-convert --apply iscsid @@ -393,6 +405,10 @@ fi /bin/systemctl try-restart iscsid.service >/dev/null 2>&1 || : /bin/systemctl try-restart iscsi.service >/dev/null 1>&1 || : +%triggerun iscsiuio -- iscsi-initiator-utils < 6.2.0.873-1 +# enable socket activation +/bin/systemctl enable iscsiuio.socket >/dev/null 2>&1 || : + %triggerun -- iscsi-initiator-utils < 6.2.0.873-22 # prior to 6.2.0.873-22 iscsi.service was missing a Wants=remote-fs-pre.target # this forces remote-fs-pre.target active if needed for a clean shutdown/reboot @@ -463,6 +479,9 @@ fi %{_includedir}/libiscsi.h %changelog +* Thu Jan 15 2015 Chris Leech - 6.2.0.873-28 +- 1180100 scriptlets were never split out properly for the iscsiuio subpackage + * Thu Jan 15 2015 Chris Leech - 6.2.0.873-27 - 1168556 fix regression in network interface binding