Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 97687
b: refs/heads/master
c: 293ad60
h: refs/heads/master
i:
  97685: e3681e3
  97683: 135a3f5
  97679: c70200d
v: v3
  • Loading branch information
Octavian Purdila authored and David S. Miller committed Jun 4, 2008
1 parent 7f2aa45 commit c89bcb0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 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: 26af65cbeb2467a486ae4fc7242c94e470c67c50
refs/heads/master: 293ad60401da621b8b329abbe8c388edb25f658a
5 changes: 3 additions & 2 deletions trunk/net/core/skbuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -1445,6 +1445,7 @@ int skb_splice_bits(struct sk_buff *__skb, unsigned int offset,

if (spd.nr_pages) {
int ret;
struct sock *sk = __skb->sk;

/*
* Drop the socket lock, otherwise we have reverse
Expand All @@ -1455,9 +1456,9 @@ int skb_splice_bits(struct sk_buff *__skb, unsigned int offset,
* we call into ->sendpage() with the i_mutex lock held
* and networking will grab the socket lock.
*/
release_sock(__skb->sk);
release_sock(sk);
ret = splice_to_pipe(pipe, &spd);
lock_sock(__skb->sk);
lock_sock(sk);
return ret;
}

Expand Down
9 changes: 8 additions & 1 deletion trunk/net/ipv4/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,14 @@ int tcp_read_sock(struct sock *sk, read_descriptor_t *desc,
copied += used;
offset += used;
}
if (offset != skb->len)
/*
* If recv_actor drops the lock (e.g. TCP splice
* receive) the skb pointer might be invalid when
* getting here: tcp_collapse might have deleted it
* while aggregating skbs from the socket queue.
*/
skb = tcp_recv_skb(sk, seq-1, &offset);
if (!skb || (offset+1 != skb->len))
break;
}
if (tcp_hdr(skb)->fin) {
Expand Down

0 comments on commit c89bcb0

Please sign in to comment.