svn commit: r273307 - in stable/10/sys: cam/ctl dev/iscsi

Alexander Motin mav at FreeBSD.org
Mon Oct 20 07:28:20 UTC 2014


Author: mav
Date: Mon Oct 20 07:28:18 2014
New Revision: 273307
URL: https://svnweb.freebsd.org/changeset/base/273307

Log:
  MFC r271395 (by trasz):
  Make sure we handle less than zero timeouts in iSCSI initiator and target
  in a reasonable way.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  stable/10/sys/cam/ctl/ctl_frontend_iscsi.c
  stable/10/sys/dev/iscsi/iscsi.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c
==============================================================================
--- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c	Mon Oct 20 07:27:34 2014	(r273306)
+++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c	Mon Oct 20 07:28:18 2014	(r273307)
@@ -997,7 +997,7 @@ cfiscsi_callout(void *context)
 
 #ifdef ICL_KERNEL_PROXY
 	if (cs->cs_waiting_for_ctld || cs->cs_login_phase) {
-		if (cs->cs_timeout > login_timeout) {
+		if (login_timeout > 0 && cs->cs_timeout > login_timeout) {
 			CFISCSI_SESSION_WARN(cs, "login timed out after "
 			    "%d seconds; dropping connection", cs->cs_timeout);
 			cfiscsi_session_terminate(cs);

Modified: stable/10/sys/dev/iscsi/iscsi.c
==============================================================================
--- stable/10/sys/dev/iscsi/iscsi.c	Mon Oct 20 07:27:34 2014	(r273306)
+++ stable/10/sys/dev/iscsi/iscsi.c	Mon Oct 20 07:28:18 2014	(r273307)
@@ -543,7 +543,7 @@ iscsi_callout(void *context)
 	is->is_timeout++;
 
 	if (is->is_waiting_for_iscsid) {
-		if (is->is_timeout > iscsid_timeout) {
+		if (iscsid_timeout > 0 && is->is_timeout > iscsid_timeout) {
 			ISCSI_SESSION_WARN(is, "timed out waiting for iscsid(8) "
 			    "for %d seconds; reconnecting",
 			    is->is_timeout);
@@ -553,7 +553,7 @@ iscsi_callout(void *context)
 	}
 
 	if (is->is_login_phase) {
-		if (is->is_timeout > login_timeout) {
+		if (login_timeout > 0 && is->is_timeout > login_timeout) {
 			ISCSI_SESSION_WARN(is, "login timed out after %d seconds; "
 			    "reconnecting", is->is_timeout);
 			reconnect_needed = true;
@@ -561,6 +561,16 @@ iscsi_callout(void *context)
 		goto out;
 	}
 
+	if (ping_timeout <= 0) {
+		/*
+		 * Pings are disabled.  Don't send NOP-Out in this case.
+		 * Reset the timeout, to avoid triggering reconnection,
+		 * should the user decide to reenable them.
+		 */
+		is->is_timeout = 0;
+		goto out;
+	}
+
 	if (is->is_timeout >= ping_timeout) {
 		ISCSI_SESSION_WARN(is, "no ping reply (NOP-In) after %d seconds; "
 		    "reconnecting", ping_timeout);


More information about the svn-src-all mailing list