summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_event.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-12-07 10:04:43 +0000
committerphk <phk@FreeBSD.org>2003-12-07 10:04:43 +0000
commit888f0e51c6a3f2c87ff863b9f5116e922a82dfd3 (patch)
treeeee2a5221c10d02fda24737c175c57eb0fb3ef09 /sys/geom/geom_event.c
parent4ce13c1db4410a92cd4c5e4e0358a1d72c76c0c4 (diff)
downloadFreeBSD-src-888f0e51c6a3f2c87ff863b9f5116e922a82dfd3.zip
FreeBSD-src-888f0e51c6a3f2c87ff863b9f5116e922a82dfd3.tar.gz
KASSERT against multiple orphanings of providers.
Diffstat (limited to 'sys/geom/geom_event.c')
-rw-r--r--sys/geom/geom_event.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/geom/geom_event.c b/sys/geom/geom_event.c
index b2b3095..3c0f19f 100644
--- a/sys/geom/geom_event.c
+++ b/sys/geom/geom_event.c
@@ -106,8 +106,12 @@ g_orphan_provider(struct g_provider *pp, int error)
KASSERT(error != 0,
("g_orphan_provider(%p(%s), 0) error must be non-zero\n",
pp, pp->name));
+
pp->error = error;
mtx_lock(&g_eventlock);
+ KASSERT(!(pp->flags & G_PF_ORPHAN),
+ ("g_orphan_provider(%p(%s)), already an orphan", pp, pp->name));
+ pp->flags |= G_PF_ORPHAN;
TAILQ_INSERT_TAIL(&g_doorstep, pp, orphan);
mtx_unlock(&g_eventlock);
wakeup(&g_wait_event);
OpenPOWER on IntegriCloud