From 9aff1d71c4f915e37a488b2a5d6d51cc11f5be85 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Tue, 8 Sep 2009 11:28:14 -0700 Subject: [PATCH] PIPE - Fix a panic introduced by the last commit. * Forgot to release a token on the Re-tests. Reported-by: Tobias Weingartner --- sys/kern/sys_pipe.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index 67eea50e27..bc7812aec1 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -597,8 +597,10 @@ pipe_read(struct file *fp, struct uio *uio, struct ucred *cred, int fflags) * Retest EOF - acquiring a new token can temporarily release * tokens already held. */ - if (rpipe->pipe_state & PIPE_REOF) + if (rpipe->pipe_state & PIPE_REOF) { + lwkt_reltoken(&wlock); break; + } /* * If there is no more to read in the pipe, reset its @@ -908,6 +910,7 @@ pipe_write(struct file *fp, struct uio *uio, struct ucred *cred, int fflags) * tokens already held. */ if (wpipe->pipe_state & PIPE_WEOF) { + lwkt_reltoken(&rlock); error = EPIPE; break; } -- 2.41.0