Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Sep 2012 12:41:49 +0000 (UTC)
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r240822 - head/sys/geom
Message-ID:  <201209221241.q8MCfnhJ067937@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pjd
Date: Sat Sep 22 12:41:49 2012
New Revision: 240822
URL: http://svn.freebsd.org/changeset/base/240822

Log:
  Use the topology lock to protect list of providers while withering them.
  It is possible that provider is destroyed while we are iterating over the
  list.
  
  Reported by:	Brian Parkison <parkison@panzura.com>
  Discussed with:	phk
  MFC after:	1 week

Modified:
  head/sys/geom/geom_disk.c

Modified: head/sys/geom/geom_disk.c
==============================================================================
--- head/sys/geom/geom_disk.c	Sat Sep 22 12:40:52 2012	(r240821)
+++ head/sys/geom/geom_disk.c	Sat Sep 22 12:41:49 2012	(r240822)
@@ -635,10 +635,13 @@ disk_gone(struct disk *dp)
 	struct g_geom *gp;
 	struct g_provider *pp;
 
+	g_topology_lock();
 	gp = dp->d_geom;
-	if (gp != NULL)
+	if (gp != NULL) {
 		LIST_FOREACH(pp, &gp->provider, provider)
 			g_wither_provider(pp, ENXIO);
+	}
+	g_topology_unlock();
 }
 
 void



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