svn commit: r300901 - head/sys/net

Bjoern A. Zeeb bz at FreeBSD.org
Sat May 28 08:32:16 UTC 2016


Author: bz
Date: Sat May 28 08:32:15 2016
New Revision: 300901
URL: https://svnweb.freebsd.org/changeset/base/300901

Log:
  In if_attachdomain1() there does not seem to be any reason
  to use TRYLOCK rather than just acquire the lock, so just do that.
  
  Reviewed by:		markj
  Obtained from:		projects/vnet
  MFC after:		2 weeks
  Sponsored by:		The FreeBSD Foundation
  Differential Revision:	https://reviews.freebsd.org/D6578

Modified:
  head/sys/net/if.c

Modified: head/sys/net/if.c
==============================================================================
--- head/sys/net/if.c	Sat May 28 06:24:48 2016	(r300900)
+++ head/sys/net/if.c	Sat May 28 08:32:15 2016	(r300901)
@@ -821,8 +821,7 @@ if_attachdomain1(struct ifnet *ifp)
 	 * Since dp->dom_ifattach calls malloc() with M_WAITOK, we
 	 * cannot lock ifp->if_afdata initialization, entirely.
 	 */
-	if (IF_AFDATA_TRYLOCK(ifp) == 0)
-		return;
+	IF_AFDATA_LOCK(ifp);
 	if (ifp->if_afdata_initialized >= domain_init_status) {
 		IF_AFDATA_UNLOCK(ifp);
 		log(LOG_WARNING, "%s called more than once on %s\n",


More information about the svn-src-all mailing list