summaryrefslogtreecommitdiff
path: root/sys/nfs
diff options
context:
space:
mode:
authorVitaliy Makkoveev <mvs@cvs.openbsd.org>2024-07-12 17:20:19 +0000
committerVitaliy Makkoveev <mvs@cvs.openbsd.org>2024-07-12 17:20:19 +0000
commite3daaa046926cc1a80d1db22554bd479e81e2a32 (patch)
tree975e82d8693178ea9c65df7372c814f25e1ab049 /sys/nfs
parent4eced7c1ad4c0354f4f30729abcb079291417876 (diff)
Switch `so_snd' of udp(4) sockets to the new locking scheme.
udp_send() and following udp{,6}_output() do not append packets to `so_snd' socket buffer. This mean the sosend() and sosplice() sending paths are dummy pru_send() and there is no problems to simultaneously run them on the same socket. Push shared solock() deep down to sesend() and take it only around pru_send(), but keep somove() running unedr exclusive solock(). Since sosend() doesn't modify `so_snd' the unlocked `so_snd' space checks within somove() are safe. Corresponding `sb_state' and `sb_flags' modifications are protected by `sb_mtx' mutex(9). Tested and OK bluhm.
Diffstat (limited to 'sys/nfs')
-rw-r--r--sys/nfs/nfs_socket.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/nfs/nfs_socket.c b/sys/nfs/nfs_socket.c
index c6ec74e1cc3..f75122ed20d 100644
--- a/sys/nfs/nfs_socket.c
+++ b/sys/nfs/nfs_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_socket.c,v 1.150 2024/04/30 17:05:20 miod Exp $ */
+/* $OpenBSD: nfs_socket.c,v 1.151 2024/07/12 17:20:18 mvs Exp $ */
/* $NetBSD: nfs_socket.c,v 1.27 1996/04/15 20:20:00 thorpej Exp $ */
/*
@@ -374,7 +374,9 @@ nfs_connect(struct nfsmount *nmp, struct nfsreq *rep)
mtx_enter(&so->so_rcv.sb_mtx);
so->so_rcv.sb_flags |= SB_NOINTR;
mtx_leave(&so->so_rcv.sb_mtx);
+ mtx_enter(&so->so_snd.sb_mtx);
so->so_snd.sb_flags |= SB_NOINTR;
+ mtx_leave(&so->so_snd.sb_mtx);
sounlock(so);
m_freem(mopt);