summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--etc/iscsid.conf7
-rw-r--r--usr/initiator.c3
2 files changed, 6 insertions, 4 deletions
diff --git a/etc/iscsid.conf b/etc/iscsid.conf
index dec3857..00ce546 100644
--- a/etc/iscsid.conf
+++ b/etc/iscsid.conf
@@ -294,9 +294,10 @@ discovery.sendtargets.iscsi.MaxRecvDataSegmentLength = 32768
node.session.nr_sessions = 1
# When iscsid starts up it recovers existing sesssions, if possible.
-# If the target has gone away when this occurs, this value
-# limits the number of retries to re-login.
-# Retries are done every 2 seconds.
+# If the target for a session has gone away when this occurs, this
+# configuration value limits the number of retries to re-login, which
+# are done every 2 seconds. A value of 0 implies to retry forever,
+# which is not recommended.
node.session.reopen_max = 32
#************
diff --git a/usr/initiator.c b/usr/initiator.c
index be53c35..f4c9e02 100644
--- a/usr/initiator.c
+++ b/usr/initiator.c
@@ -733,7 +733,8 @@ static void iscsi_login_eh(struct iscsi_conn *conn, struct queue_task *qtask,
log_debug(6, "login failed ISCSI_CONN_STATE_XPT_WAIT/"
"R_STAGE_SESSION_REOPEN (reopen_cnt=%d, reopen_max=%d)",
session->reopen_cnt, session->reopen_max);
- if (session->reopen_cnt > session->reopen_max) {
+ if (session->reopen_max &&
+ (session->reopen_cnt > session->reopen_max)) {
log_info("Giving up on session %d after %d retries",
session->id, session->reopen_max);
session_conn_shutdown(conn, qtask, err);