From 7322ba7d8ba6b4e81600ec8d3c6497e25564bc25 Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Thu, 24 Jun 2004 03:12:13 +0000 Subject: [PATCH] When updating sb_flags, acquire the socket buffer lock to prevent races. --- sys/nfsclient/nfs_socket.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/nfsclient/nfs_socket.c b/sys/nfsclient/nfs_socket.c index 4485cd29c701..483f0b09477e 100644 --- a/sys/nfsclient/nfs_socket.c +++ b/sys/nfsclient/nfs_socket.c @@ -319,8 +319,12 @@ nfs_connect(struct nfsmount *nmp, struct nfsreq *rep) error = soreserve(so, sndreserve, rcvreserve); if (error) goto bad; + SOCKBUF_LOCK(&so->so_rcv); so->so_rcv.sb_flags |= SB_NOINTR; + SOCKBUF_UNLOCK(&so->so_rcv); + SOCKBUF_LOCK(&so->so_snd); so->so_snd.sb_flags |= SB_NOINTR; + SOCKBUF_UNLOCK(&so->so_snd); /* Initialize other non-zero congestion variables */ nmp->nm_srtt[0] = nmp->nm_srtt[1] = nmp->nm_srtt[2] =