mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 19:00:25 +00:00
[SCSI] iscsi: dequeue all buffers from queue
debugged by wrwhitehead@novell.com patch and analysis by fujita.tomonori@lab.ntt.co.jp Only tcp_read_sock and recv_actor (iscsi_tcp_data_recv for us) see desc.count. It is is used just for permitting tcp_read_sock to read the portion of data in the socket. When iscsi_tcp_data_recv sees a partial header, it sets desc.count. However, it is possible that the next skb (containing the rest of the header) still does not come. So I'm not sure that this scheme is completely correct. Ideally, we should use the exact length of the data in the socket for desc.count. However, it is not so simple (see SIOCINQ in tcp_ioctl). So I think that iscsi_tcp_data_recv can just stop playing with desc.count and tell tcp_read_sock to read the all skbs. As proposed already, if iscsi_tcp_data_ready sets desc.count to non-zero, tcp_read_sock does that. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
This commit is contained in:
parent
8d2860b3c3
commit
665b44aee3
1 changed files with 8 additions and 6 deletions
|
@ -922,11 +922,8 @@ iscsi_tcp_data_recv(read_descriptor_t *rd_desc, struct sk_buff *skb,
|
||||||
|
|
||||||
rc = iscsi_data_recv(conn);
|
rc = iscsi_data_recv(conn);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
if (rc == -EAGAIN) {
|
if (rc == -EAGAIN)
|
||||||
rd_desc->count = tcp_conn->in.datalen -
|
|
||||||
tcp_conn->in.ctask->data_count;
|
|
||||||
goto again;
|
goto again;
|
||||||
}
|
|
||||||
iscsi_conn_failure(conn, rc);
|
iscsi_conn_failure(conn, rc);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -983,9 +980,14 @@ iscsi_tcp_data_ready(struct sock *sk, int flag)
|
||||||
|
|
||||||
read_lock(&sk->sk_callback_lock);
|
read_lock(&sk->sk_callback_lock);
|
||||||
|
|
||||||
/* use rd_desc to pass 'conn' to iscsi_tcp_data_recv */
|
/*
|
||||||
|
* Use rd_desc to pass 'conn' to iscsi_tcp_data_recv.
|
||||||
|
* We set count to 1 because we want the network layer to
|
||||||
|
* hand us all the skbs that are available. iscsi_tcp_data_recv
|
||||||
|
* handled pdus that cross buffers or pdus that still need data.
|
||||||
|
*/
|
||||||
rd_desc.arg.data = conn;
|
rd_desc.arg.data = conn;
|
||||||
rd_desc.count = 0;
|
rd_desc.count = 1;
|
||||||
tcp_read_sock(sk, &rd_desc, iscsi_tcp_data_recv);
|
tcp_read_sock(sk, &rd_desc, iscsi_tcp_data_recv);
|
||||||
|
|
||||||
read_unlock(&sk->sk_callback_lock);
|
read_unlock(&sk->sk_callback_lock);
|
||||||
|
|
Loading…
Reference in a new issue