Skip to content

Commit

Permalink
[SCSI] iscsi_tcp: wake xmit thread when killing session
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mike Christie authored and James Bottomley committed Feb 17, 2010
1 parent 9f9127f commit b64e77f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/scsi/iscsi_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -584,9 +584,10 @@ static void iscsi_sw_tcp_conn_stop(struct iscsi_cls_conn *cls_conn, int flag)
struct iscsi_conn *conn = cls_conn->dd_data;
struct iscsi_tcp_conn *tcp_conn = conn->dd_data;
struct iscsi_sw_tcp_conn *tcp_sw_conn = tcp_conn->dd_data;
struct socket *sock = tcp_sw_conn->sock;

/* userspace may have goofed up and not bound us */
if (!tcp_sw_conn->sock)
if (!sock)
return;
/*
* Make sure our recv side is stopped.
Expand All @@ -597,6 +598,11 @@ static void iscsi_sw_tcp_conn_stop(struct iscsi_cls_conn *cls_conn, int flag)
set_bit(ISCSI_SUSPEND_BIT, &conn->suspend_rx);
write_unlock_bh(&tcp_sw_conn->sock->sk->sk_callback_lock);

if (sock->sk->sk_sleep && waitqueue_active(sock->sk->sk_sleep)) {
sock->sk->sk_err = EIO;
wake_up_interruptible(sock->sk->sk_sleep);
}

iscsi_conn_stop(cls_conn, flag);
iscsi_sw_tcp_release_conn(conn);
}
Expand Down

0 comments on commit b64e77f

Please sign in to comment.