Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Jul 2015 18:37:24 +0000 (UTC)
From:      "Conrad E. Meyer" <cem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r285971 - stable/10/sys/kern
Message-ID:  <201507281837.t6SIbOtQ065584@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cem
Date: Tue Jul 28 18:37:23 2015
New Revision: 285971
URL: https://svnweb.freebsd.org/changeset/base/285971

Log:
  MFC r285483: 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.
  
  Approved by:	markj (mentor)
  Sponsored by:	EMC / Isilon Storage Division

Modified:
  stable/10/sys/kern/sys_pipe.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/sys_pipe.c
==============================================================================
--- stable/10/sys/kern/sys_pipe.c	Tue Jul 28 17:48:34 2015	(r285970)
+++ stable/10/sys/kern/sys_pipe.c	Tue Jul 28 18:37:23 2015	(r285971)
@@ -945,9 +945,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?201507281837.t6SIbOtQ065584>