summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authoranton <anton@cvs.openbsd.org>2020-02-01 15:52:35 +0000
committeranton <anton@cvs.openbsd.org>2020-02-01 15:52:35 +0000
commitb64dd5ecec2bf41c2c80d44647c042fe1386f59c (patch)
tree373562d2ec102b3831df56e5ebf2a480e1309428 /sys/kern
parenta34b47c14d22f07a2207de3d3fa37357efe71c56 (diff)
Back out previous. Nothing wrong with the diff per se but I should have
asked for more oks; my bad!
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_sig.c4
-rw-r--r--sys/kern/sys_pipe.c9
2 files changed, 7 insertions, 6 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index 9400330d3a1..1e781ac7018 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sig.c,v 1.244 2020/02/01 15:06:21 anton Exp $ */
+/* $OpenBSD: kern_sig.c,v 1.245 2020/02/01 15:52:34 anton Exp $ */
/* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */
/*
@@ -740,7 +740,6 @@ pgsigio(struct sigio_ref *sir, int sig, int checkctty)
if (sir->sir_sigio == NULL)
return;
- KERNEL_LOCK();
mtx_enter(&sigio_lock);
sigio = sir->sir_sigio;
if (sigio == NULL)
@@ -757,7 +756,6 @@ pgsigio(struct sigio_ref *sir, int sig, int checkctty)
}
out:
mtx_leave(&sigio_lock);
- KERNEL_UNLOCK();
}
/*
diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c
index 59d519845ca..d266a201d3d 100644
--- a/sys/kern/sys_pipe.c
+++ b/sys/kern/sys_pipe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys_pipe.c,v 1.114 2020/02/01 15:06:21 anton Exp $ */
+/* $OpenBSD: sys_pipe.c,v 1.115 2020/02/01 15:52:34 anton Exp $ */
/*
* Copyright (c) 1996 John S. Dyson
@@ -372,17 +372,20 @@ pipeselwakeup(struct pipe *cpipe)
{
rw_assert_wrlock(cpipe->pipe_lock);
- /* Kernel lock needed in order to prevent race with kevent. */
KERNEL_LOCK();
+
+ /* Kernel lock needed in order to prevent race with kevent. */
if (cpipe->pipe_state & PIPE_SEL) {
cpipe->pipe_state &= ~PIPE_SEL;
selwakeup(&cpipe->pipe_sel);
} else
KNOTE(&cpipe->pipe_sel.si_note, NOTE_SUBMIT);
- KERNEL_UNLOCK();
+ /* Kernel lock needed since pgsigio() calls ptsignal(). */
if (cpipe->pipe_state & PIPE_ASYNC)
pgsigio(&cpipe->pipe_sigio, SIGIO, 0);
+
+ KERNEL_UNLOCK();
}
int