summaryrefslogtreecommitdiff
path: root/sys/nfs/nfs_syscalls.c
diff options
context:
space:
mode:
authorVitaliy Makkoveev <mvs@cvs.openbsd.org>2024-03-31 13:50:01 +0000
committerVitaliy Makkoveev <mvs@cvs.openbsd.org>2024-03-31 13:50:01 +0000
commit85ba99673a1a61f19fe34c8d73f813e102afc5d1 (patch)
tree5d51253cc717e3eaea0f647493cdad649cd1dc22 /sys/nfs/nfs_syscalls.c
parent9aab307608358726e3412975f4eb4eea55b05aaa (diff)
Mark `so_rcv' sockbuf of udp(4) sockets as SB_OWNLOCK.
sbappend*() and soreceive() of SB_MTXLOCK marked sockets uses `sb_mtx' mutex(9) for protection, meanwhile buffer usage check and corresponding sbwait() sleep still serialized by solock(). Mark udp(4) as SB_OWNLOCK to avoid solock() serialization and rely to `sb_mtx' mutex(9). The `sb_state' and `sb_flags' modifications must be protected by `sb_mtx' too. ok bluhm
Diffstat (limited to 'sys/nfs/nfs_syscalls.c')
-rw-r--r--sys/nfs/nfs_syscalls.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/nfs/nfs_syscalls.c b/sys/nfs/nfs_syscalls.c
index f3ccd3f5c16..32f28f021e0 100644
--- a/sys/nfs/nfs_syscalls.c
+++ b/sys/nfs/nfs_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_syscalls.c,v 1.122 2024/03/22 07:15:04 claudio Exp $ */
+/* $OpenBSD: nfs_syscalls.c,v 1.123 2024/03/31 13:50:00 mvs Exp $ */
/* $NetBSD: nfs_syscalls.c,v 1.19 1996/02/18 11:53:52 fvdl Exp $ */
/*
@@ -297,12 +297,12 @@ nfssvc_addsock(struct file *fp, struct mbuf *mynam)
m_freem(m);
}
solock(so);
- so->so_rcv.sb_flags &= ~SB_NOINTR;
mtx_enter(&so->so_rcv.sb_mtx);
+ so->so_rcv.sb_flags &= ~SB_NOINTR;
so->so_rcv.sb_timeo_nsecs = INFSLP;
mtx_leave(&so->so_rcv.sb_mtx);
- so->so_snd.sb_flags &= ~SB_NOINTR;
mtx_enter(&so->so_snd.sb_mtx);
+ so->so_snd.sb_flags &= ~SB_NOINTR;
so->so_snd.sb_timeo_nsecs = INFSLP;
mtx_leave(&so->so_snd.sb_mtx);
sounlock(so);