summaryrefslogtreecommitdiffstats
path: root/sys/dev/iscsi
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2014-10-20 07:28:18 +0000
committermav <mav@FreeBSD.org>2014-10-20 07:28:18 +0000
commit072d9b12cad6e0a19c457a7b6b5bbe31540b642a (patch)
tree6a606813308aaa7c76b52ca78f7f7bf93b694eb2 /sys/dev/iscsi
parent7aaab4b0ed52a57f5bcb9af530b18ba47b9032f4 (diff)
downloadFreeBSD-src-072d9b12cad6e0a19c457a7b6b5bbe31540b642a.zip
FreeBSD-src-072d9b12cad6e0a19c457a7b6b5bbe31540b642a.tar.gz
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
Diffstat (limited to 'sys/dev/iscsi')
-rw-r--r--sys/dev/iscsi/iscsi.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/dev/iscsi/iscsi.c b/sys/dev/iscsi/iscsi.c
index d958ee2..659d74e 100644
--- a/sys/dev/iscsi/iscsi.c
+++ b/sys/dev/iscsi/iscsi.c
@@ -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);
OpenPOWER on IntegriCloud