summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortanimura <tanimura@FreeBSD.org>2002-05-21 02:37:56 +0000
committertanimura <tanimura@FreeBSD.org>2002-05-21 02:37:56 +0000
commit6ecf0c65a78da6e5aec7dd2bd5d4c22f05040758 (patch)
tree0171552d2836fae33dd3c3885f34116edf1f4356
parent4d3e3e5ebac7f4d3810a362c7d6479e27386a040 (diff)
downloadFreeBSD-src-6ecf0c65a78da6e5aec7dd2bd5d4c22f05040758.zip
FreeBSD-src-6ecf0c65a78da6e5aec7dd2bd5d4c22f05040758.tar.gz
Lock the writer socket across sorwakeup(fip->fi_writesock).
Spotted by: peter
-rw-r--r--sys/fs/fifofs/fifo_vnops.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/fs/fifofs/fifo_vnops.c b/sys/fs/fifofs/fifo_vnops.c
index 71ba03c..4494871 100644
--- a/sys/fs/fifofs/fifo_vnops.c
+++ b/sys/fs/fifofs/fifo_vnops.c
@@ -224,11 +224,13 @@ fifo_open(ap)
if (fip->fi_writers == 1) {
SOCK_LOCK(fip->fi_readsock);
fip->fi_readsock->so_state &= ~SS_CANTRCVMORE;
+ SOCK_UNLOCK(fip->fi_readsock);
if (fip->fi_readers > 0) {
wakeup((caddr_t)&fip->fi_readers);
+ SOCK_LOCK(fip->fi_writesock);
sorwakeup(fip->fi_writesock);
+ SOCK_UNLOCK(fip->fi_writesock);
}
- SOCK_UNLOCK(fip->fi_readsock);
}
}
if ((ap->a_mode & FREAD) && (ap->a_mode & O_NONBLOCK) == 0) {
OpenPOWER on IntegriCloud