diff options
| author | John Ericson <John.Ericson@Obsidian.Systems> | 2026-08-10 15:04:23 +0000 |
|---|---|---|
| committer | Mark Johnston <markj@FreeBSD.org> | 2026-08-10 17:31:21 +0000 |
| commit | 26147c51546ecc98791db66fa4d948348bf4ec7b (patch) | |
| tree | e6ec985a7b6e72cf9f96de5475bb64595b85aaf6 /sys/dev/ppbus | |
| parent | 44e99b67283517207d4e482feee63bc15f4f710e (diff) | |
unix: pin the pathname peer by reference across the connect
In the pathname path of `unp_connectat()`, take a reference on the peer
socket under the per-vnode `unp_vp_mtxpool` lock, drop that lock, and
`vput()` the vnode *before* calling `unp_connect_peer()`, rather than
holding the vnode lock across the connect.
`unp_connect_peer()` already accepts "a reference on the peer socket" as
a stability guarantee (it is exactly what the descriptor path relies on),
so this is behaviour-preserving. The payoff is that no vnode lock is held
across the connect, which removes the delicate `MPASS(!(return_locked &&
connreq))` "vput() must not sleep while the peer is locked" invariant on
the datagram fast path.
That reference then has to be released, and for the reasons described in
the code, this can only safely happen *after* the PCB is unlocked. The
boolean flag is replaced with a nullable out pointer to return the
reference to the caller so that it can carry out this responsibility.
No functional change intended.
Signed-off-by: John Ericson <John.Ericson@Obsidian.Systems>
Assisted-by: Claude Code (Claude Opus 4.8 and Fable 5)
Reviewed by: markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D58460
Diffstat (limited to 'sys/dev/ppbus')
0 files changed, 0 insertions, 0 deletions
