Files
linux/fs
Eric Dumazet 9f55757482 tcp: fix MSG_SENDPAGE_NOTLAST logic
[ Upstream commit ae62ca7b03 ]

commit 35f9c09fe9 (tcp: tcp_sendpages() should call tcp_push() once)
added an internal flag : MSG_SENDPAGE_NOTLAST meant to be set on all
frags but the last one for a splice() call.

The condition used to set the flag in pipe_to_sendpage() relied on
splice() user passing the exact number of bytes present in the pipe,
or a smaller one.

But some programs pass an arbitrary high value, and the test fails.

The effect of this bug is a lack of tcp_push() at the end of a
splice(pipe -> socket) call, and possibly very slow or erratic TCP
sessions.

We should both test sd->total_len and fact that another fragment
is in the pipe (pipe->nrbufs > 1)

Many thanks to Willy for providing very clear bug report, bisection
and test programs.

Reported-by: Willy Tarreau <w@1wt.eu>
Bisected-by: Willy Tarreau <w@1wt.eu>
Tested-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-14 10:47:36 -08:00
..
2011-07-17 23:20:29 -04:00
2012-09-14 10:00:50 -07:00
2011-11-11 09:35:59 -08:00
2011-06-20 17:53:24 -05:00
2012-11-26 11:34:33 -08:00
2011-07-17 23:21:35 -04:00
2012-11-17 13:14:25 -08:00
2011-07-06 12:15:16 -07:00
2012-09-14 10:00:37 -07:00
2011-05-26 10:01:43 -06:00
2013-02-14 10:47:36 -08:00