svn commit: r240822 - head/sys/geom
Pawel Jakub Dawidek
pjd at FreeBSD.org
Sat Sep 22 12:41:50 UTC 2012
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 at 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
More information about the svn-src-head
mailing list