Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 161111
b: refs/heads/master
c: d1af8a3
h: refs/heads/master
i:
  161109: 6ab0cd2
  161107: f0a4cf1
  161103: 1fa86e1
v: v3
  • Loading branch information
Mike Christie authored and James Bottomley committed Sep 5, 2009
1 parent ec0a946 commit 166867a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 632248aab3170004e24512a4378fc6d9d7f3b4ac
refs/heads/master: d1af8a328755f51c9b76157a8692e56520d3fd94
23 changes: 9 additions & 14 deletions trunk/drivers/scsi/iscsi_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,14 @@ static int iscsi_sw_tcp_recv(read_descriptor_t *rd_desc, struct sk_buff *skb,
*/
static inline int iscsi_sw_sk_state_check(struct sock *sk)
{
if ((sk->sk_state == TCP_CLOSE_WAIT ||
sk->sk_state == TCP_CLOSE) &&
!atomic_read(&sk->sk_rmem_alloc))
return -ECONNRESET;
struct iscsi_conn *conn = (struct iscsi_conn*)sk->sk_user_data;

if ((sk->sk_state == TCP_CLOSE_WAIT || sk->sk_state == TCP_CLOSE) &&
!atomic_read(&sk->sk_rmem_alloc)) {
ISCSI_SW_TCP_DBG(conn, "TCP_CLOSE|TCP_CLOSE_WAIT\n");
iscsi_conn_failure(conn, ISCSI_ERR_TCP_CONN_CLOSE);
return -ECONNRESET;
}
return 0;
}

Expand All @@ -135,11 +138,7 @@ static void iscsi_sw_tcp_data_ready(struct sock *sk, int flag)
rd_desc.count = 1;
tcp_read_sock(sk, &rd_desc, iscsi_sw_tcp_recv);

if (iscsi_sw_sk_state_check(sk) < 0) {
ISCSI_SW_TCP_DBG(conn, "iscsi_tcp_data_ready: "
"TCP_CLOSE|TCP_CLOSE_WAIT\n");
iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED);
}
iscsi_sw_sk_state_check(sk);

read_unlock(&sk->sk_callback_lock);

Expand All @@ -161,11 +160,7 @@ static void iscsi_sw_tcp_state_change(struct sock *sk)
conn = (struct iscsi_conn*)sk->sk_user_data;
session = conn->session;

if (iscsi_sw_sk_state_check(sk) < 0) {
ISCSI_SW_TCP_DBG(conn, "iscsi_tcp_state_change: "
"TCP_CLOSE|TCP_CLOSE_WAIT\n");
iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED);
}
iscsi_sw_sk_state_check(sk);

tcp_conn = conn->dd_data;
tcp_sw_conn = tcp_conn->dd_data;
Expand Down
1 change: 1 addition & 0 deletions trunk/include/scsi/iscsi_if.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ enum iscsi_err {
ISCSI_ERR_NO_SCSI_CMD = ISCSI_ERR_BASE + 17,
ISCSI_ERR_INVALID_HOST = ISCSI_ERR_BASE + 18,
ISCSI_ERR_XMIT_FAILED = ISCSI_ERR_BASE + 19,
ISCSI_ERR_TCP_CONN_CLOSE = ISCSI_ERR_BASE + 20,
};

/*
Expand Down

0 comments on commit 166867a

Please sign in to comment.