Currently, when conn bind fails, iscsi_conn_connect is called and it
reschedules the login_timer by adding it to the pending list while
it's actually already there. This will create an infinite loop when
the pending list is processed.

To fix that, use queue_delayed_reopen which first calls actor_delete
to make sure the actor is not in the list before rescheduling it.

Signed-off-by: Ariel Nahum <[email protected]>
Signed-off-by: Roi Dayan <[email protected]>
---
 usr/initiator.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/usr/initiator.c b/usr/initiator.c
index 05a5b19..067cf0a 100644
--- a/usr/initiator.c
+++ b/usr/initiator.c
@@ -543,8 +543,7 @@ static int iscsi_conn_connect(struct iscsi_conn *conn, 
queue_task_t *qtask)
        iscsi_sched_ev_context(ev_context, conn, 0, EV_CONN_POLL);
        log_debug(3, "Setting login timer %p timeout %d", &conn->login_timer,
                  conn->login_timeout);
-       actor_timer(&conn->login_timer, conn->login_timeout * 1000,
-                   iscsi_login_timedout, qtask);
+       queue_delayed_reopen(qtask, conn->login_timeout);
        return 0;
 }
 
-- 
1.7.1

-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to