aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r--net/ipv4/tcp.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index dcf51fbf5ec7..78ac4d2e3827 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1753,6 +1753,7 @@ static int tcp_zerocopy_receive(struct sock *sk,
1753 struct vm_area_struct *vma; 1753 struct vm_area_struct *vma;
1754 struct sk_buff *skb = NULL; 1754 struct sk_buff *skb = NULL;
1755 struct tcp_sock *tp; 1755 struct tcp_sock *tp;
1756 int inq;
1756 int ret; 1757 int ret;
1757 1758
1758 if (address & (PAGE_SIZE - 1) || address != zc->address) 1759 if (address & (PAGE_SIZE - 1) || address != zc->address)
@@ -1773,12 +1774,15 @@ static int tcp_zerocopy_receive(struct sock *sk,
1773 1774
1774 tp = tcp_sk(sk); 1775 tp = tcp_sk(sk);
1775 seq = tp->copied_seq; 1776 seq = tp->copied_seq;
1776 zc->length = min_t(u32, zc->length, tcp_inq(sk)); 1777 inq = tcp_inq(sk);
1778 zc->length = min_t(u32, zc->length, inq);
1777 zc->length &= ~(PAGE_SIZE - 1); 1779 zc->length &= ~(PAGE_SIZE - 1);
1778 1780 if (zc->length) {
1779 zap_page_range(vma, address, zc->length); 1781 zap_page_range(vma, address, zc->length);
1780 1782 zc->recv_skip_hint = 0;
1781 zc->recv_skip_hint = 0; 1783 } else {
1784 zc->recv_skip_hint = inq;
1785 }
1782 ret = 0; 1786 ret = 0;
1783 while (length + PAGE_SIZE <= zc->length) { 1787 while (length + PAGE_SIZE <= zc->length) {
1784 if (zc->recv_skip_hint < PAGE_SIZE) { 1788 if (zc->recv_skip_hint < PAGE_SIZE) {