Date: Mon, 13 Jul 2015 17:45:23 +0000 (UTC) From: "Conrad E. Meyer" <cem@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285483 - head/sys/kern Message-ID: <201507131745.t6DHjNSn061454@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201507131745.t6DHjNSn061454>