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
This commit is contained in:
Pawel Jakub Dawidek 2012-09-22 12:41:49 +00:00
parent 5677eef9a7
commit 171f6b3a34

View File

@ -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