From owner-svn-src-head@freebsd.org Mon Jul 13 17:45:23 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4723999B4A4; Mon, 13 Jul 2015 17:45:23 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 38203AA0; Mon, 13 Jul 2015 17:45:23 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6DHjNmb061455; Mon, 13 Jul 2015 17:45:23 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6DHjNSn061454; Mon, 13 Jul 2015 17:45:23 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201507131745.t6DHjNSn061454@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Mon, 13 Jul 2015 17:45:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285483 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jul 2015 17:45:23 -0000 Author: cem Date: Mon Jul 13 17:45:22 2015 New Revision: 285483 URL: https://svnweb.freebsd.org/changeset/base/285483 Log: pipe_direct_write: Fix mismatched pipelock/unlock If a signal is caught in pipelock, causing it to fail, pipe_direct_write should not try to pipeunlock. Reported by: pho Differential Revision: https://reviews.freebsd.org/D3069 Reviewed by: kib Approved by: markj (mentor) MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/sys/kern/sys_pipe.c Modified: head/sys/kern/sys_pipe.c ============================================================================== --- head/sys/kern/sys_pipe.c Mon Jul 13 17:40:24 2015 (r285482) +++ head/sys/kern/sys_pipe.c Mon Jul 13 17:45:22 2015 (r285483) @@ -946,9 +946,10 @@ pipe_direct_write(wpipe, uio) retry: PIPE_LOCK_ASSERT(wpipe, MA_OWNED); error = pipelock(wpipe, 1); - if (wpipe->pipe_state & PIPE_EOF) + if (error != 0) + goto error1; + if ((wpipe->pipe_state & PIPE_EOF) != 0) { error = EPIPE; - if (error) { pipeunlock(wpipe); goto error1; }