]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/commit
MFC r222454:
authortrociny <trociny@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 15 Jun 2011 20:34:40 +0000 (20:34 +0000)
committertrociny <trociny@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 15 Jun 2011 20:34:40 +0000 (20:34 +0000)
commit59eec3892fa645495acf6c29061a0b3838b96872
tree572efebb3213109845e0ebabc7de9db20b6bd36c
parent31464e9145796d396017c99195607d406faf6883
MFC r222454:

In soreceive_generic(), if MSG_WAITALL is set but the request is
larger than the receive buffer, we have to receive in sections.
When notifying the protocol that some data has been drained the
lock is released for a moment. Returning we block waiting for the
rest of data. There is a race, when data could arrive while the
lock was released and then the connection stalls in sbwait.

Fix this by checking for data before blocking and skip blocking
if there are some.

PR: kern/154504
Reported by: Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua>
Tested by: Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua>
Reviewed by: rwatson

Approved by: pjd (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/8@223119 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/kern/uipc_socket.c