From owner-cvs-src-old@FreeBSD.ORG Sun May 29 18:01:09 2011 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52CD31065670 for ; Sun, 29 May 2011 18:01:09 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 426CC8FC08 for ; Sun, 29 May 2011 18:01:09 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.4/8.14.4) with ESMTP id p4TI197T017991 for ; Sun, 29 May 2011 18:01:09 GMT (envelope-from trociny@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.4/8.14.4/Submit) id p4TI19YS017990 for cvs-src-old@freebsd.org; Sun, 29 May 2011 18:01:09 GMT (envelope-from trociny@repoman.freebsd.org) Message-Id: <201105291801.p4TI19YS017990@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to trociny@repoman.freebsd.org using -f From: Mikolaj Golub Date: Sun, 29 May 2011 18:00:50 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/kern uipc_socket.c X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 May 2011 18:01:09 -0000 trociny 2011-05-29 18:00:50 UTC FreeBSD src repository Modified files: sys/kern uipc_socket.c Log: SVN rev 222454 on 2011-05-29 18:00:50Z by trociny 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 Tested by: Andrey Simonenko Reviewed by: rwatson Approved by: kib (co-mentor) MFC after: 2 weeks Revision Changes Path 1.355 +10 -4 src/sys/kern/uipc_socket.c