CVSROOT: /cvs Module name: src Changes by: m...@cvs.openbsd.org 2024/05/03 11:43:10
Modified files: sys/kern : uipc_socket.c uipc_socket2.c uipc_usrreq.c sys/miscfs/fifofs: fifo_vnops.c sys/sys : socketvar.h Log message: Push solock() down to sosend() and remove it from soreceive() paths fro unix(4) sockets. Push solock() deep down to sosend() and remove it from soreceive() paths for unix(4) sockets. The transmission of unix(4) sockets already half-unlocked because connected peer is not locked by solock() during sbappend*() call. Use `sb_mtx' mutex(9) and `sb_lock' rwlock(9) to protect both `so_snd' and `so_rcv'. Since the `so_snd' is protected by `sb_mtx' mutex(9) the re-locking is not required in uipc_rcvd(). Do direct `so_rcv' dispose and cleanup in sofree(). This sockets is almost dead and unlinked from everywhere include spliced peer, so concurrent sotask() thread will just exit. This required to keep locks order between `i_lock' and `sb_lock'. Also this removes re-locking from sofree() for all sockets. SB_OWNLOCK became redundant with SB_MTXLOCK, so remove it. SB_MTXLOCK was kept because checks against SB_MTXLOCK within sb*() routines are mor consistent. Feedback and ok bluhm