Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F159034547
D35182.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
990 B
Referenced Files
None
Subscribers
None
D35182.diff
View Options
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -1634,6 +1634,9 @@
sotounpcb(so2) == unp2,
("%s: unp2 %p so2 %p", __func__, unp2, so2));
unp_connect2(so, so2, PRU_CONNECT);
+ KASSERT((unp->unp_flags & UNP_CONNECTING) != 0,
+ ("%s: unp %p has UNP_CONNECTING clear", __func__, unp));
+ unp->unp_flags &= ~UNP_CONNECTING;
unp_pcb_unlock_pair(unp, unp2);
bad2:
mtx_unlock(vplock);
@@ -1642,11 +1645,13 @@
vput(vp);
}
free(sa, M_SONAME);
- UNP_PCB_LOCK(unp);
- KASSERT((unp->unp_flags & UNP_CONNECTING) != 0,
- ("%s: unp %p has UNP_CONNECTING clear", __func__, unp));
- unp->unp_flags &= ~UNP_CONNECTING;
- UNP_PCB_UNLOCK(unp);
+ if (__predict_false(error)) {
+ UNP_PCB_LOCK(unp);
+ KASSERT((unp->unp_flags & UNP_CONNECTING) != 0,
+ ("%s: unp %p has UNP_CONNECTING clear", __func__, unp));
+ unp->unp_flags &= ~UNP_CONNECTING;
+ UNP_PCB_UNLOCK(unp);
+ }
return (error);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jun 10, 7:53 AM (2 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33845647
Default Alt Text
D35182.diff (990 B)
Attached To
Mode
D35182: unix: microoptimize unp_connectat() - one less lock on success
Attached
Detach File
Event Timeline
Log In to Comment