From owner-cvs-all@FreeBSD.ORG Sun Feb 22 15:00:15 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2516016A4CE; Sun, 22 Feb 2004 15:00:15 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2061E43D1F; Sun, 22 Feb 2004 15:00:15 -0800 (PST) (envelope-from green@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i1MN0EGe018761; Sun, 22 Feb 2004 15:00:14 -0800 (PST) (envelope-from green@repoman.freebsd.org) Received: (from green@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i1MN0E0Q018760; Sun, 22 Feb 2004 15:00:14 -0800 (PST) (envelope-from green) Message-Id: <200402222300.i1MN0E0Q018760@repoman.freebsd.org> From: Brian Feldman Date: Sun, 22 Feb 2004 15:00:14 -0800 (PST) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/kern sys_pipe.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Feb 2004 23:00:15 -0000 green 2004/02/22 15:00:14 PST FreeBSD src repository Modified files: sys/kern sys_pipe.c Log: Correct some major SMP-harmful problems in the pipe implementation. First of all, PIPE_EOF is not checked pervasively after everything that can drop the pipe mutex and msleep(), so fix. Additionally, though it might not harm anything, pipelock() and pipeunlock() are not used consistently. Third, the kqueue support functions do not use the pipe mutex correctly. Last, but absolutely not least, is a race: if pipe_busy is not set on the closing side of the pipe, the other side that is trying to write to that will crash BECAUSE PIPE_EOF IS NOT SET! Unconditionally set PIPE_EOF, and get rid of all the lockups/crashes I have seen trying to build ports. Revision Changes Path 1.168 +66 -41 src/sys/kern/sys_pipe.c