Page MenuHomeFreeBSD

socket: Rename sb(un)lock() and interlock with listen(2)
ClosedPublic

Authored by markj on Aug 24 2021, 2:01 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 27, 10:31 AM
Unknown Object (File)
Dec 2 2024, 8:39 PM
Unknown Object (File)
Nov 28 2024, 6:25 PM
Unknown Object (File)
Nov 28 2024, 6:24 PM
Unknown Object (File)
Nov 28 2024, 6:23 PM
Unknown Object (File)
Nov 28 2024, 6:22 PM
Unknown Object (File)
Nov 28 2024, 6:02 PM
Unknown Object (File)
Nov 13 2024, 5:58 PM
Subscribers

Details

Summary

In preparation for moving sockbuf locks into the containing socket,
provide macros for the sockbuf I/O locks: SOCK_IO_SEND_(UN)LOCK() and
SOCK_IO_RECV_(UN)LOCK(). These locks are only used to prevent
concurrent readers and writters from interleaving I/O, so the new names
are more descriptive.

When locking for I/O, return an error if the socket is a listening
socket. Currently the check is racy since the sockbuf sx locks are
destroyed during the transition to a listening socket, but that will no
longer be true after some follow-up changes.

Modify a few places to check for errors from
sblock()/SOCK_IO_(SEND|RECV)_LOCK() where they were not before. In
particular, add checks to sendfile() and sorflush().

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 41300
Build 38189: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Aug 24 2021, 2:35 PM

Remove unneeded error handling from vn_sendfile().
The sendfile_sync structure is freed at the end of the function.

This revision now requires review to proceed.Aug 31 2021, 7:08 PM
This revision is now accepted and ready to land.Sep 1 2021, 8:23 AM