diff options
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/libiscsi.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index 010c1b9b178c..98164f3c3517 100644 --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c | |||
@@ -1453,19 +1453,20 @@ static void iscsi_check_transport_timeouts(unsigned long data) | |||
1453 | { | 1453 | { |
1454 | struct iscsi_conn *conn = (struct iscsi_conn *)data; | 1454 | struct iscsi_conn *conn = (struct iscsi_conn *)data; |
1455 | struct iscsi_session *session = conn->session; | 1455 | struct iscsi_session *session = conn->session; |
1456 | unsigned long timeout, next_timeout = 0, last_recv; | 1456 | unsigned long recv_timeout, next_timeout = 0, last_recv; |
1457 | 1457 | ||
1458 | spin_lock(&session->lock); | 1458 | spin_lock(&session->lock); |
1459 | if (session->state != ISCSI_STATE_LOGGED_IN) | 1459 | if (session->state != ISCSI_STATE_LOGGED_IN) |
1460 | goto done; | 1460 | goto done; |
1461 | 1461 | ||
1462 | timeout = conn->recv_timeout; | 1462 | recv_timeout = conn->recv_timeout; |
1463 | if (!timeout) | 1463 | if (!recv_timeout) |
1464 | goto done; | 1464 | goto done; |
1465 | 1465 | ||
1466 | timeout *= HZ; | 1466 | recv_timeout *= HZ; |
1467 | last_recv = conn->last_recv; | 1467 | last_recv = conn->last_recv; |
1468 | if (time_before_eq(last_recv + timeout + (conn->ping_timeout * HZ), | 1468 | if (conn->ping_mtask && |
1469 | time_before_eq(conn->last_ping + (conn->ping_timeout * HZ), | ||
1469 | jiffies)) { | 1470 | jiffies)) { |
1470 | iscsi_conn_printk(KERN_ERR, conn, "ping timeout of %d secs " | 1471 | iscsi_conn_printk(KERN_ERR, conn, "ping timeout of %d secs " |
1471 | "expired, last rx %lu, last ping %lu, " | 1472 | "expired, last rx %lu, last ping %lu, " |
@@ -1476,15 +1477,15 @@ static void iscsi_check_transport_timeouts(unsigned long data) | |||
1476 | return; | 1477 | return; |
1477 | } | 1478 | } |
1478 | 1479 | ||
1479 | if (time_before_eq(last_recv + timeout, jiffies)) { | 1480 | if (time_before_eq(last_recv + recv_timeout, jiffies)) { |
1480 | if (time_before_eq(conn->last_ping, last_recv)) { | 1481 | if (time_before_eq(conn->last_ping, last_recv)) { |
1481 | /* send a ping to try to provoke some traffic */ | 1482 | /* send a ping to try to provoke some traffic */ |
1482 | debug_scsi("Sending nopout as ping on conn %p\n", conn); | 1483 | debug_scsi("Sending nopout as ping on conn %p\n", conn); |
1483 | iscsi_send_nopout(conn, NULL); | 1484 | iscsi_send_nopout(conn, NULL); |
1484 | } | 1485 | } |
1485 | next_timeout = last_recv + timeout + (conn->ping_timeout * HZ); | 1486 | next_timeout = conn->last_ping + (conn->ping_timeout * HZ); |
1486 | } else | 1487 | } else |
1487 | next_timeout = last_recv + timeout; | 1488 | next_timeout = last_recv + recv_timeout; |
1488 | 1489 | ||
1489 | debug_scsi("Setting next tmo %lu\n", next_timeout); | 1490 | debug_scsi("Setting next tmo %lu\n", next_timeout); |
1490 | mod_timer(&conn->transport_timer, next_timeout); | 1491 | mod_timer(&conn->transport_timer, next_timeout); |