rwatson 2008-02-02 12:44:14 UTC FreeBSD src repository
Modified files: (Branch: RELENG_7_0) 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_0: 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, rrs Reported by: Jos Backus <jos at catnook dot com> Approved by: re (kensmith) Revision Changes Path 1.171.2.1.2.1 +6 -2 src/sys/kern/uipc_sockbuf.c 1.302.4.1 +11 -5 src/sys/kern/uipc_socket.c 1.259.4.1 +7 -2 src/sys/kern/uipc_syscalls.c 1.65.2.1.2.1 +2 -1 src/sys/netinet/sctp_input.c 1.16.4.1 +2 -2 src/sys/netinet/sctp_peeloff.c 1.65.2.4.2.1 +1 -1 src/sys/netinet/sctputil.c 1.158.4.1 +7 -0 src/sys/sys/socketvar.h _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "[EMAIL PROTECTED]"