diff options
author | Mike Christie <michaelc@cs.wisc.edu> | 2010-02-10 17:51:47 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-02-17 14:40:16 -0500 |
commit | b64e77f70b8c11766e967e3485331a9e6ef01390 (patch) | |
tree | e0c0c6c935b2d7623d962d7f5984ecfc1420f8d2 | |
parent | 9f9127fd0cfac1ccbcf4a9456b3d36bc6971355e (diff) |
[SCSI] iscsi_tcp: wake xmit thread when killing session
If the connection is bad, then the xmit thread could
end up waiting a long time (up to sendtmeo seconds) in
tcp_sendpage. This patch has us set the sk_error and
wake up the xmit thread so we can quickly fail.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
-rw-r--r-- | drivers/scsi/iscsi_tcp.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c index 517da3fd89d3..8a89ba900588 100644 --- a/drivers/scsi/iscsi_tcp.c +++ b/drivers/scsi/iscsi_tcp.c | |||
@@ -584,9 +584,10 @@ static void iscsi_sw_tcp_conn_stop(struct iscsi_cls_conn *cls_conn, int flag) | |||
584 | struct iscsi_conn *conn = cls_conn->dd_data; | 584 | struct iscsi_conn *conn = cls_conn->dd_data; |
585 | struct iscsi_tcp_conn *tcp_conn = conn->dd_data; | 585 | struct iscsi_tcp_conn *tcp_conn = conn->dd_data; |
586 | struct iscsi_sw_tcp_conn *tcp_sw_conn = tcp_conn->dd_data; | 586 | struct iscsi_sw_tcp_conn *tcp_sw_conn = tcp_conn->dd_data; |
587 | struct socket *sock = tcp_sw_conn->sock; | ||
587 | 588 | ||
588 | /* userspace may have goofed up and not bound us */ | 589 | /* userspace may have goofed up and not bound us */ |
589 | if (!tcp_sw_conn->sock) | 590 | if (!sock) |
590 | return; | 591 | return; |
591 | /* | 592 | /* |
592 | * Make sure our recv side is stopped. | 593 | * Make sure our recv side is stopped. |
@@ -597,6 +598,11 @@ static void iscsi_sw_tcp_conn_stop(struct iscsi_cls_conn *cls_conn, int flag) | |||
597 | set_bit(ISCSI_SUSPEND_BIT, &conn->suspend_rx); | 598 | set_bit(ISCSI_SUSPEND_BIT, &conn->suspend_rx); |
598 | write_unlock_bh(&tcp_sw_conn->sock->sk->sk_callback_lock); | 599 | write_unlock_bh(&tcp_sw_conn->sock->sk->sk_callback_lock); |
599 | 600 | ||
601 | if (sock->sk->sk_sleep && waitqueue_active(sock->sk->sk_sleep)) { | ||
602 | sock->sk->sk_err = EIO; | ||
603 | wake_up_interruptible(sock->sk->sk_sleep); | ||
604 | } | ||
605 | |||
600 | iscsi_conn_stop(cls_conn, flag); | 606 | iscsi_conn_stop(cls_conn, flag); |
601 | iscsi_sw_tcp_release_conn(conn); | 607 | iscsi_sw_tcp_release_conn(conn); |
602 | } | 608 | } |