diff --git a/SOURCES/0199-use-Red-Hat-version-string-to-match-RPM-package-vers.patch b/SOURCES/0199-use-Red-Hat-version-string-to-match-RPM-package-vers.patch index 51df4bf..67e1706 100644 --- a/SOURCES/0199-use-Red-Hat-version-string-to-match-RPM-package-vers.patch +++ b/SOURCES/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-33" ++#define ISCSI_VERSION_STR "6.2.0.873-33.2" #define ISCSI_VERSION_FILE "/sys/module/scsi_transport_iscsi/version" #endif diff --git a/SOURCES/open-iscsi-0004-iscsi_tcp-set-SO_LINGER-to-abort-connection-for-e.patch b/SOURCES/open-iscsi-0004-iscsi_tcp-set-SO_LINGER-to-abort-connection-for-e.patch new file mode 100644 index 0000000..14bde90 --- /dev/null +++ b/SOURCES/open-iscsi-0004-iscsi_tcp-set-SO_LINGER-to-abort-connection-for-e.patch @@ -0,0 +1,50 @@ +From b104afd497502321765c2c1ed3f020b1fe4b400a Mon Sep 17 00:00:00 2001 +From: Chris Leech +Date: Mon, 29 Feb 2016 14:13:27 -0800 +Subject: [PATCH v2 4/9] iscsi_tcp set SO_LINGER to abort connection for error + handling + +When requests are being failed it's important to abort the TCP +connection rather than let TCP wait and attempt a graceful shutdown. + +That can be accomplished by setting the SO_LINGER socket option with a +linger time of 0 to drop queued data and close the connection with a RST +instead of a FIN. + +Signed-off-by: Chris Leech +--- + usr/io.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/usr/io.c b/usr/io.c +index f552e1e..48b233c 100644 +--- a/usr/io.c ++++ b/usr/io.c +@@ -391,9 +391,24 @@ iscsi_io_tcp_poll(iscsi_conn_t *conn, int timeout_ms) + void + iscsi_io_tcp_disconnect(iscsi_conn_t *conn) + { ++ struct linger so_linger = { .l_onoff = 1, .l_linger = 0 }; ++ + if (conn->socket_fd >= 0) { + log_debug(1, "disconnecting conn %p, fd %d", conn, + conn->socket_fd); ++ ++ /* If the state is not IN_LOGOUT, this isn't a clean shutdown ++ * and there's some sort of error handling going on. In that ++ * case, set a 0 SO_LINGER to force an abortive close (RST) and ++ * free whatever is sitting in the TCP transmit queue. This is ++ * done to prevent stale data from being sent should the ++ * network connection be restored before TCP times out. ++ */ ++ if (conn->state != ISCSI_CONN_STATE_IN_LOGOUT) { ++ setsockopt(conn->socket_fd, SOL_SOCKET, SO_LINGER, ++ &so_linger, sizeof(so_linger)); ++ } ++ + close(conn->socket_fd); + conn->socket_fd = -1; + } +-- +2.5.5 + diff --git a/SPECS/iscsi-initiator-utils.spec b/SPECS/iscsi-initiator-utils.spec index 48b4746..2091f3b 100644 --- a/SPECS/iscsi-initiator-utils.spec +++ b/SPECS/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: 33%{?dist}.1 +Release: 33%{?dist}.2 Group: System Environment/Daemons License: GPLv2+ URL: http://www.open-iscsi.org @@ -101,6 +101,7 @@ Patch128: open-iscsi-2.0-873-safe-logout-flashnode.patch Patch136: 0136-iscsiuio-Correct-the-handling-of-Multi-Function-mode.patch Patch137: 0143-iscsiuio-Add-QLogic-Vendor-ID-to-support-newer-NX2-H.patch Patch138: 0148-iscsiuio-Get-the-library-to-use-based-on-uio-sysfs-n.patch +Patch139: open-iscsi-0004-iscsi_tcp-set-SO_LINGER-to-abort-connection-for-e.patch # not (yet) upstream merged Patch130: 0130-guard-against-NULL-ptr-during-discovery-from-unexpec.patch @@ -352,6 +353,9 @@ fi %{_includedir}/libiscsi.h %changelog +* Tue Jun 28 2016 Chris Leech - 6.2.0.873-33.2 +- 1346661 ensure TCP abort on session failure to prevent data corruption with link flap + * Tue May 03 2016 Chris Leech - 6.2.0.873-33 - 1332179 added spec file Provides for 7.2.z package to support DUP request