svn commit: r359170 - in head/sys: kern sys

Mark Johnston markj at FreeBSD.org
Fri Mar 20 16:17:55 UTC 2020


Author: markj
Date: Fri Mar 20 16:17:54 2020
New Revision: 359170
URL: https://svnweb.freebsd.org/changeset/base/359170

Log:
  Remove UNP_NASCENT, reverting r303855.
  
  unp_connectat() no longer holds the link lock across calls to
  sonewconn(), so the recursion described in r303855 can no longer occur.
  No functional change intended.
  
  Tested by:	pho
  MFC after:	2 weeks
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/kern/uipc_usrreq.c
  head/sys/sys/unpcb.h

Modified: head/sys/kern/uipc_usrreq.c
==============================================================================
--- head/sys/kern/uipc_usrreq.c	Fri Mar 20 16:15:45 2020	(r359169)
+++ head/sys/kern/uipc_usrreq.c	Fri Mar 20 16:17:54 2020	(r359170)
@@ -526,8 +526,6 @@ uipc_attach(struct socket *so, int proto, struct threa
 	unp->unp_socket = so;
 	so->so_pcb = unp;
 	unp->unp_refcount = 1;
-	if (so->so_listen != NULL)
-		unp->unp_flags |= UNP_NASCENT;
 
 	if ((locked = UNP_LINK_WOWNED()) == false)
 		UNP_LINK_WLOCK();
@@ -800,9 +798,6 @@ uipc_detach(struct socket *so)
 		UNP_PCB_UNLOCK(unp);
 		goto restart;
 	}
-	if ((unp->unp_flags & UNP_NASCENT) != 0) {
-		goto teardown;
-	}
 	if ((vp = unp->unp_vnode) != NULL) {
 		VOP_UNP_DETACH(vp);
 		unp->unp_vnode = NULL;
@@ -844,7 +839,6 @@ uipc_detach(struct socket *so)
 	freeunp = unp_pcb_rele(unp);
 	MPASS(freeunp == 0);
 	local_unp_rights = unp_rights;
-teardown:
 	unp->unp_socket->so_pcb = NULL;
 	saved_unp_addr = unp->unp_addr;
 	unp->unp_addr = NULL;
@@ -1685,7 +1679,6 @@ unp_connect2(struct socket *so, struct socket *so2, in
 
 	if (so2->so_type != so->so_type)
 		return (EPROTOTYPE);
-	unp2->unp_flags &= ~UNP_NASCENT;
 	unp->unp_conn = unp2;
 	unp_pcb_hold(unp2);
 	unp_pcb_hold(unp);

Modified: head/sys/sys/unpcb.h
==============================================================================
--- head/sys/sys/unpcb.h	Fri Mar 20 16:15:45 2020	(r359169)
+++ head/sys/sys/unpcb.h	Fri Mar 20 16:17:54 2020	(r359170)
@@ -110,7 +110,6 @@ struct unpcb {
  */
 #define	UNP_CONNECTING			0x010	/* Currently connecting. */
 #define	UNP_BINDING			0x020	/* Currently binding. */
-#define	UNP_NASCENT			0x040	/* Newborn child socket. */
 
 /*
  * Flags in unp_gcflag.


More information about the svn-src-all mailing list