From 13ee8e1649c248310a83e722463d0afc5f7ddb7a Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Sat, 9 Nov 2013 03:19:33 +0000 Subject: [PATCH] We were setting the next timeout check to be the current time plus the timeout value. The problem is that if commands were started at 00:00:05 and 00:00:10 and the timeout value was 15 seconds and the first command completed ok, then conn_rsp_timer_fn would have run at 00:00:20 and rescheduled the next conn_rsp_timer_fn run for 15 secs from that time (00:00:35). But, we would have wanted to check on the second command at 15 secs after its write_start time which is 00:00:25. This patch has us reschedule the next conn_rsp_timer_fn run for the req's write_start time + its timeout. Signed-off-by: Mike Christie git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5093 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/kernel/conn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iscsi-scst/kernel/conn.c b/iscsi-scst/kernel/conn.c index 031f28650..0aa83dcbb 100644 --- a/iscsi-scst/kernel/conn.c +++ b/iscsi-scst/kernel/conn.c @@ -520,7 +520,7 @@ static void conn_rsp_timer_fn(unsigned long arg) cmnd = list_first_entry(&conn->write_timeout_list, struct iscsi_cmnd, write_timeout_list_entry); - timeout_time = j + iscsi_get_timeout(cmnd) + ISCSI_ADD_SCHED_TIME; + timeout_time = iscsi_get_timeout_time(cmnd) + ISCSI_ADD_SCHED_TIME; if (unlikely(time_after_eq(j, iscsi_get_timeout_time(cmnd)))) { if (!conn->closing) {