diff options
Diffstat (limited to 'drivers/scsi/iscsi_tcp.c')
-rw-r--r-- | drivers/scsi/iscsi_tcp.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c index edc49ca49cea..02143af7c1af 100644 --- a/drivers/scsi/iscsi_tcp.c +++ b/drivers/scsi/iscsi_tcp.c | |||
@@ -28,6 +28,7 @@ | |||
28 | 28 | ||
29 | #include <linux/types.h> | 29 | #include <linux/types.h> |
30 | #include <linux/inet.h> | 30 | #include <linux/inet.h> |
31 | #include <linux/slab.h> | ||
31 | #include <linux/file.h> | 32 | #include <linux/file.h> |
32 | #include <linux/blkdev.h> | 33 | #include <linux/blkdev.h> |
33 | #include <linux/crypto.h> | 34 | #include <linux/crypto.h> |
@@ -584,9 +585,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; | 585 | struct iscsi_conn *conn = cls_conn->dd_data; |
585 | struct iscsi_tcp_conn *tcp_conn = conn->dd_data; | 586 | struct iscsi_tcp_conn *tcp_conn = conn->dd_data; |
586 | struct iscsi_sw_tcp_conn *tcp_sw_conn = tcp_conn->dd_data; | 587 | struct iscsi_sw_tcp_conn *tcp_sw_conn = tcp_conn->dd_data; |
588 | struct socket *sock = tcp_sw_conn->sock; | ||
587 | 589 | ||
588 | /* userspace may have goofed up and not bound us */ | 590 | /* userspace may have goofed up and not bound us */ |
589 | if (!tcp_sw_conn->sock) | 591 | if (!sock) |
590 | return; | 592 | return; |
591 | /* | 593 | /* |
592 | * Make sure our recv side is stopped. | 594 | * Make sure our recv side is stopped. |
@@ -597,6 +599,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); | 599 | set_bit(ISCSI_SUSPEND_BIT, &conn->suspend_rx); |
598 | write_unlock_bh(&tcp_sw_conn->sock->sk->sk_callback_lock); | 600 | write_unlock_bh(&tcp_sw_conn->sock->sk->sk_callback_lock); |
599 | 601 | ||
602 | if (sock->sk->sk_sleep) { | ||
603 | sock->sk->sk_err = EIO; | ||
604 | wake_up_interruptible(sock->sk->sk_sleep); | ||
605 | } | ||
606 | |||
600 | iscsi_conn_stop(cls_conn, flag); | 607 | iscsi_conn_stop(cls_conn, flag); |
601 | iscsi_sw_tcp_release_conn(conn); | 608 | iscsi_sw_tcp_release_conn(conn); |
602 | } | 609 | } |
@@ -868,7 +875,7 @@ static struct scsi_host_template iscsi_sw_tcp_sht = { | |||
868 | .cmd_per_lun = ISCSI_DEF_CMD_PER_LUN, | 875 | .cmd_per_lun = ISCSI_DEF_CMD_PER_LUN, |
869 | .eh_abort_handler = iscsi_eh_abort, | 876 | .eh_abort_handler = iscsi_eh_abort, |
870 | .eh_device_reset_handler= iscsi_eh_device_reset, | 877 | .eh_device_reset_handler= iscsi_eh_device_reset, |
871 | .eh_target_reset_handler= iscsi_eh_target_reset, | 878 | .eh_target_reset_handler = iscsi_eh_recover_target, |
872 | .use_clustering = DISABLE_CLUSTERING, | 879 | .use_clustering = DISABLE_CLUSTERING, |
873 | .slave_alloc = iscsi_sw_tcp_slave_alloc, | 880 | .slave_alloc = iscsi_sw_tcp_slave_alloc, |
874 | .slave_configure = iscsi_sw_tcp_slave_configure, | 881 | .slave_configure = iscsi_sw_tcp_slave_configure, |
@@ -903,7 +910,7 @@ static struct iscsi_transport iscsi_sw_tcp_transport = { | |||
903 | ISCSI_USERNAME | ISCSI_PASSWORD | | 910 | ISCSI_USERNAME | ISCSI_PASSWORD | |
904 | ISCSI_USERNAME_IN | ISCSI_PASSWORD_IN | | 911 | ISCSI_USERNAME_IN | ISCSI_PASSWORD_IN | |
905 | ISCSI_FAST_ABORT | ISCSI_ABORT_TMO | | 912 | ISCSI_FAST_ABORT | ISCSI_ABORT_TMO | |
906 | ISCSI_LU_RESET_TMO | | 913 | ISCSI_LU_RESET_TMO | ISCSI_TGT_RESET_TMO | |
907 | ISCSI_PING_TMO | ISCSI_RECV_TMO | | 914 | ISCSI_PING_TMO | ISCSI_RECV_TMO | |
908 | ISCSI_IFACE_NAME | ISCSI_INITIATOR_NAME, | 915 | ISCSI_IFACE_NAME | ISCSI_INITIATOR_NAME, |
909 | .host_param_mask = ISCSI_HOST_HWADDRESS | ISCSI_HOST_IPADDRESS | | 916 | .host_param_mask = ISCSI_HOST_HWADDRESS | ISCSI_HOST_IPADDRESS | |