Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 May 2016 08:32:15 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r300901 - head/sys/net
Message-ID:  <201605280832.u4S8WF87010106@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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",



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605280832.u4S8WF87010106>