]> git.baikalelectronics.ru Git - kernel.git/commit
net: add POLLPRI to sock_def_readable()
authorEric Dumazet <eric.dumazet@gmail.com>
Thu, 6 Jan 2011 18:54:29 +0000 (10:54 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 6 Jan 2011 18:54:29 +0000 (10:54 -0800)
commit4bd471a21812602b57cfd33b5e660b6194084d77
tree38156d2a938e5f346d7c4464e132132f7279dcba
parent9677bda830149fc2864ac16aab40dd0ed486e69d
net: add POLLPRI to sock_def_readable()

Leonardo Chiquitto found poll() could block forever on tcp sockets and
Urgent data was received, if the event flag only contains POLLPRI.

He did a bisection and found commit d494f836f1a (poll: avoid extra
wakeups in select/poll) was the source of the problem.

Problem is TCP sockets use standard sock_def_readable() function for
their sk_data_ready() handler, and sock_def_readable() doesnt signal
POLLPRI.

Only TCP is affected by the problem. Adding POLLPRI to the list of flags
might trigger unnecessary schedules, but URGENT handling is such a
seldom used feature this seems a good compromise.

Thanks a lot to Leonardo for providing the bisection result and a test
program as well.

Reference : http://www.spinics.net/lists/netdev/msg151793.html

Reported-and-bisected-by: Leonardo Chiquitto <leonardo.lists@gmail.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Tested-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/sock.c