Partially close race between calls of orphan() method from GEOM and close()

method from ZFS core, that reliably causes use-after-free panic if SSD vdev
detached during inititial erase.
This commit is contained in:
Alexander Motin 2013-07-28 20:07:34 +00:00
parent 12bdf23a3a
commit 698cd997d6

View File

@ -69,6 +69,8 @@ vdev_geom_orphan(struct g_consumer *cp)
g_topology_assert();
vd = cp->private;
if (vd == NULL)
return;
/*
* Orphan callbacks occur from the GEOM event thread.
@ -689,6 +691,7 @@ vdev_geom_close(vdev_t *vd)
return;
vd->vdev_tsd = NULL;
vd->vdev_delayed_close = B_FALSE;
cp->private = NULL; /* XXX locking */
g_post_event(vdev_geom_detach, cp, M_WAITOK, NULL);
}