From ee476487704fe774885be4895a3779f782e141de Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Sun, 25 Sep 2005 19:52:09 +0000 Subject: [PATCH] Lock the read socket receive buffer when frobbing the sb_state flag on that socket during open, not the write socket receive buffer. This might explain clearing of the sb_state SB_LOCK flag seen occasionally in soreceive() on fifos. MFC after: 3 days Spotted by: ups --- sys/fs/fifofs/fifo_vnops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/fs/fifofs/fifo_vnops.c b/sys/fs/fifofs/fifo_vnops.c index f47b826515b3..8c43e78a9679 100644 --- a/sys/fs/fifofs/fifo_vnops.c +++ b/sys/fs/fifofs/fifo_vnops.c @@ -247,9 +247,9 @@ fail1: } fip->fi_writers++; if (fip->fi_writers == 1) { - SOCKBUF_LOCK(&fip->fi_writesock->so_rcv); + SOCKBUF_LOCK(&fip->fi_readsock->so_rcv); fip->fi_readsock->so_rcv.sb_state &= ~SBS_CANTRCVMORE; - SOCKBUF_UNLOCK(&fip->fi_writesock->so_rcv); + SOCKBUF_UNLOCK(&fip->fi_readsock->so_rcv); if (fip->fi_readers > 0) { wakeup(&fip->fi_readers); sorwakeup(fip->fi_readsock);