From owner-cvs-src@FreeBSD.ORG Fri Feb 1 22:51:41 2008 Return-Path: Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D9B116A420; Fri, 1 Feb 2008 22:51:41 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 4ECB513C474; Fri, 1 Feb 2008 22:51:41 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m11MpfOw016904; Fri, 1 Feb 2008 22:51:41 GMT (envelope-from rwatson@repoman.freebsd.org) Received: (from rwatson@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m11MpeQE016903; Fri, 1 Feb 2008 22:51:41 GMT (envelope-from rwatson) Message-Id: <200802012251.m11MpeQE016903@repoman.freebsd.org> From: Robert Watson Date: Fri, 1 Feb 2008 22:51:40 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: RELENG_7 Cc: Subject: cvs commit: src/sys/kern uipc_sockbuf.c uipc_socket.c uipc_syscalls.c src/sys/netinet sctp_input.c sctp_peeloff.c sctputil.c src/sys/sys socketvar.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2008 22:51:41 -0000 rwatson 2008-02-01 22:51:40 UTC FreeBSD src repository Modified files: (Branch: RELENG_7) sys/kern uipc_sockbuf.c uipc_socket.c uipc_syscalls.c sys/netinet sctp_input.c sctp_peeloff.c sctputil.c sys/sys socketvar.h Log: Merge uipc_sockbuf.c:1.175, uipc_socket.c:1.304, uipc_syscalls.c:1.264, sctp_input.c:1.67, sctp_peeloff.c:1.17, sctputil.c:1.73, socketvar.h:1.161 from HEAD to RELENG_7: Correct two problems relating to sorflush(), which is called to flush read socket buffers in shutdown() and close(): - Call socantrcvmore() before sblock() to dislodge any threads that might be sleeping (potentially indefinitely) while holding sblock(), such as a thread blocked in recv(). - Flag the sblock() call as non-interruptible so that a signal delivered to the thread calling sorflush() doesn't cause sblock() to fail. The sblock() is required to ensure that all other socket consumer threads have, in fact, left, and do not enter, the socket buffer until we're done flushin it. To implement the latter, change the 'flags' argument to sblock() to accept two flags, SBL_WAIT and SBL_NOINTR, rather than one M_WAITOK flag. When SBL_NOINTR is set, it forces a non-interruptible sx acquisition, regardless of the setting of the disposition of SB_NOINTR on the socket buffer; without this change it would be possible for another thread to clear SB_NOINTR between when the socket buffer mutex is released and sblock() is invoked. Reviewed by: bz, kmacy Reported by: Jos Backus Revision Changes Path 1.171.2.2 +6 -2 src/sys/kern/uipc_sockbuf.c 1.302.2.1 +11 -5 src/sys/kern/uipc_socket.c 1.259.2.1 +7 -2 src/sys/kern/uipc_syscalls.c 1.65.2.2 +2 -1 src/sys/netinet/sctp_input.c 1.16.2.1 +2 -2 src/sys/netinet/sctp_peeloff.c 1.65.2.5 +1 -1 src/sys/netinet/sctputil.c 1.158.2.1 +7 -0 src/sys/sys/socketvar.h