diff options
author | phk <phk@FreeBSD.org> | 2003-12-07 10:04:43 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-12-07 10:04:43 +0000 |
commit | 888f0e51c6a3f2c87ff863b9f5116e922a82dfd3 (patch) | |
tree | eee2a5221c10d02fda24737c175c57eb0fb3ef09 | |
parent | 4ce13c1db4410a92cd4c5e4e0358a1d72c76c0c4 (diff) | |
download | FreeBSD-src-888f0e51c6a3f2c87ff863b9f5116e922a82dfd3.zip FreeBSD-src-888f0e51c6a3f2c87ff863b9f5116e922a82dfd3.tar.gz |
KASSERT against multiple orphanings of providers.
-rw-r--r-- | sys/geom/geom.h | 1 | ||||
-rw-r--r-- | sys/geom/geom_event.c | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/sys/geom/geom.h b/sys/geom/geom.h index 8e06d20..0420eea 100644 --- a/sys/geom/geom.h +++ b/sys/geom/geom.h @@ -171,6 +171,7 @@ struct g_provider { u_int flags; #define G_PF_CANDELETE 0x1 #define G_PF_WITHER 0x2 +#define G_PF_ORPHAN 0x4 }; /* geom_dev.c */ 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); |