diff options
author | rwatson <rwatson@FreeBSD.org> | 2004-06-24 03:12:13 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2004-06-24 03:12:13 +0000 |
commit | 6b9af88e9d8685c8d4ffce1d83480740ce6e6a81 (patch) | |
tree | 194380eb9a9526ea1d46ee04041ffd59549810f1 /sys/nfsclient/nfs_socket.c | |
parent | 0d284628a08bdb91c59659ae26a8ebcaa7e8871c (diff) | |
download | FreeBSD-src-6b9af88e9d8685c8d4ffce1d83480740ce6e6a81.zip FreeBSD-src-6b9af88e9d8685c8d4ffce1d83480740ce6e6a81.tar.gz |
When updating sb_flags, acquire the socket buffer lock to prevent
races.
Diffstat (limited to 'sys/nfsclient/nfs_socket.c')
-rw-r--r-- | sys/nfsclient/nfs_socket.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/nfsclient/nfs_socket.c b/sys/nfsclient/nfs_socket.c index 4485cd2..483f0b0 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] = |