summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorle <le@FreeBSD.org>2004-06-16 14:41:04 +0000
committerle <le@FreeBSD.org>2004-06-16 14:41:04 +0000
commitc2c39c895678d3e7ac762a0370704c00a5f851bb (patch)
tree33a093d93d5d77276951b18f914832f20c2f0c48 /sys
parentdf666606e40b3eceb25bbd6cedf1d5fb125047ca (diff)
downloadFreeBSD-src-c2c39c895678d3e7ac762a0370704c00a5f851bb.zip
FreeBSD-src-c2c39c895678d3e7ac762a0370704c00a5f851bb.tar.gz
Handle dead disks in a somewhat sane way.
Diffstat (limited to 'sys')
-rw-r--r--sys/geom/vinum/geom_vinum_drive.c11
-rw-r--r--sys/geom/vinum/geom_vinum_plex.c5
-rw-r--r--sys/geom/vinum/geom_vinum_subr.c3
-rw-r--r--sys/geom/vinum/geom_vinum_volume.c5
4 files changed, 21 insertions, 3 deletions
diff --git a/sys/geom/vinum/geom_vinum_drive.c b/sys/geom/vinum/geom_vinum_drive.c
index 3673255..5d3a381 100644
--- a/sys/geom/vinum/geom_vinum_drive.c
+++ b/sys/geom/vinum/geom_vinum_drive.c
@@ -264,6 +264,8 @@ static void
gv_drive_orphan(struct g_consumer *cp)
{
struct g_geom *gp;
+ struct gv_drive *d;
+ struct gv_sd *s;
int error;
g_topology_assert();
@@ -278,6 +280,15 @@ gv_drive_orphan(struct g_consumer *cp)
g_destroy_consumer(cp);
if (!LIST_EMPTY(&gp->consumer))
return;
+ d = gp->softc;
+ printf("gvinum: lost drive '%s'\n", d->name);
+ d->geom = NULL;
+ LIST_FOREACH(s, &d->subdisks, from_drive) {
+ s->provider = NULL;
+ s->consumer = NULL;
+ }
+ gv_set_drive_state(d, GV_DRIVE_DOWN, GV_SETSTATE_FORCE);
+ gp->softc = NULL;
g_wither_geom(gp, error);
}
diff --git a/sys/geom/vinum/geom_vinum_plex.c b/sys/geom/vinum/geom_vinum_plex.c
index a7acf72..beceee0 100644
--- a/sys/geom/vinum/geom_vinum_plex.c
+++ b/sys/geom/vinum/geom_vinum_plex.c
@@ -67,7 +67,10 @@ gv_plex_orphan(struct g_consumer *cp)
p = gp->softc;
gv_kill_thread(p);
- g_free(p);
+ p->geom = NULL;
+ gp->softc = NULL;
+ p->provider = NULL;
+ p->consumer = NULL;
g_wither_geom(gp, error);
}
diff --git a/sys/geom/vinum/geom_vinum_subr.c b/sys/geom/vinum/geom_vinum_subr.c
index 9c7d713..c1fe580 100644
--- a/sys/geom/vinum/geom_vinum_subr.c
+++ b/sys/geom/vinum/geom_vinum_subr.c
@@ -750,7 +750,8 @@ gv_is_open(struct g_geom *gp)
{
struct g_consumer *cp;
- KASSERT(gp != NULL, ("gv_is_open: NULL gp"));
+ if (gp == NULL)
+ return (0);
LIST_FOREACH(cp, &gp->consumer, consumer) {
if (cp->acr || cp->acw || cp->ace)
diff --git a/sys/geom/vinum/geom_vinum_volume.c b/sys/geom/vinum/geom_vinum_volume.c
index c916af4..c39d1e4 100644
--- a/sys/geom/vinum/geom_vinum_volume.c
+++ b/sys/geom/vinum/geom_vinum_volume.c
@@ -46,6 +46,7 @@ static void
gv_volume_orphan(struct g_consumer *cp)
{
struct g_geom *gp;
+ struct gv_volume *v;
int error;
g_topology_assert();
@@ -60,7 +61,9 @@ gv_volume_orphan(struct g_consumer *cp)
g_destroy_consumer(cp);
if (!LIST_EMPTY(&gp->consumer))
return;
- g_free(gp->softc);
+ v = gp->softc;
+ v->geom = NULL;
+ gp->softc = NULL;
g_wither_geom(gp, error);
}
OpenPOWER on IntegriCloud