The session_conn_uio_poll function reschedules itself in the same was as
session_conn_poll, by calling iscsi_sched_ev_context with a delay.  That
delay needs to not be ignored.

Actually, most all of the cases in iscsi_sched_ev_context can use
actor_timer to ensure any passed delay argument is honored (even if most
of them are passed as 0).

Signed-off-by: Chris Leech <[email protected]>
---
 usr/initiator.c | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/usr/initiator.c b/usr/initiator.c
index 83bbdbf..40c7b63 100644
--- a/usr/initiator.c
+++ b/usr/initiator.c
@@ -1799,9 +1799,8 @@ static int iscsi_sched_ev_context(struct iscsi_ev_context 
*ev_context,
        ev_context->conn = conn;
        switch (event) {
        case EV_CONN_RECV_PDU:
-               actor_init(&ev_context->actor, session_conn_recv_pdu,
-                         ev_context);
-               actor_schedule(&ev_context->actor);
+               actor_timer(&ev_context->actor, tmo,
+                           session_conn_recv_pdu, ev_context);
                break;
        case EV_CONN_ERROR:
                error = *(enum iscsi_err *)ev_context->data;
@@ -1819,27 +1818,24 @@ static int iscsi_sched_ev_context(struct 
iscsi_ev_context *ev_context,
                        actor_schedule(&ev_context->actor);
                break;
        case EV_CONN_LOGIN:
-               actor_init(&ev_context->actor, session_conn_process_login,
-                         ev_context);
-               actor_schedule(&ev_context->actor);
+               actor_timer(&ev_context->actor, tmo,
+                           session_conn_process_login, ev_context);
                break;
        case EV_CONN_POLL:
                actor_timer(&ev_context->actor, tmo,
                            session_conn_poll, ev_context);
                break;
        case EV_UIO_POLL:
-               actor_init(&ev_context->actor, session_conn_uio_poll,
-                         ev_context);
-               actor_schedule(&ev_context->actor);
+               actor_timer(&ev_context->actor, tmo,
+                           session_conn_uio_poll, ev_context);
                break;
        case EV_CONN_LOGOUT_TIMER:
                actor_timer(&ev_context->actor, tmo,
                            iscsi_logout_timedout, ev_context);
                break;
        case EV_CONN_STOP:
-               actor_init(&ev_context->actor, iscsi_stop,
-                         ev_context);
-               actor_schedule(&ev_context->actor);
+               actor_timer(&ev_context->actor, tmo,
+                           iscsi_stop, ev_context);
                break;
        default:
                log_error("Invalid event type %d.", event);
-- 
2.1.0

-- 
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