[SCSI] libiscsi regression in 2.6.25: fix setting of recv timer

If the ping tmo is longer than the recv tmo then we could miss a window
where we were supposed to check the recv tmo. This happens because
the ping code will set the next timeout for the ping timeout, and if the
ping executes quickly there will be a long chunk of time before the
timer wakes up again.

This patch has the ping processing code kick off a recv
tmo check when getting a nop in response to our ping.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Cc: Stable Tree <stable@kernel.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>

authored by Mike Christie and committed by James Bottomley c8611f97 4cf10435

+6 -6
+6 -6
drivers/scsi/libiscsi.c
··· 730 if (iscsi_recv_pdu(conn->cls_conn, hdr, data, 731 datalen)) 732 rc = ISCSI_ERR_CONN_FAILED; 733 - } 734 iscsi_free_mgmt_task(conn, mtask); 735 break; 736 default: ··· 1480 } 1481 1482 if (time_before_eq(last_recv + recv_timeout, jiffies)) { 1483 - if (time_before_eq(conn->last_ping, last_recv)) { 1484 - /* send a ping to try to provoke some traffic */ 1485 - debug_scsi("Sending nopout as ping on conn %p\n", conn); 1486 - iscsi_send_nopout(conn, NULL); 1487 - } 1488 next_timeout = conn->last_ping + (conn->ping_timeout * HZ); 1489 } else 1490 next_timeout = last_recv + recv_timeout;
··· 730 if (iscsi_recv_pdu(conn->cls_conn, hdr, data, 731 datalen)) 732 rc = ISCSI_ERR_CONN_FAILED; 733 + } else 734 + mod_timer(&conn->transport_timer, 735 + jiffies + conn->recv_timeout); 736 iscsi_free_mgmt_task(conn, mtask); 737 break; 738 default: ··· 1478 } 1479 1480 if (time_before_eq(last_recv + recv_timeout, jiffies)) { 1481 + /* send a ping to try to provoke some traffic */ 1482 + debug_scsi("Sending nopout as ping on conn %p\n", conn); 1483 + iscsi_send_nopout(conn, NULL); 1484 next_timeout = conn->last_ping + (conn->ping_timeout * HZ); 1485 } else 1486 next_timeout = last_recv + recv_timeout;