From 102638407ca0400fd7bbf52244d9c6a7f7f023b9 Mon Sep 17 00:00:00 2001 From: Seigo Tanimura Date: Tue, 21 May 2002 02:37:56 +0000 Subject: [PATCH] Lock the writer socket across sorwakeup(fip->fi_writesock). Spotted by: peter --- sys/fs/fifofs/fifo_vnops.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/fs/fifofs/fifo_vnops.c b/sys/fs/fifofs/fifo_vnops.c index 71ba03ce2cd5..449487160afa 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) {