diff options
author | le <le@FreeBSD.org> | 2005-08-16 15:12:44 +0000 |
---|---|---|
committer | le <le@FreeBSD.org> | 2005-08-16 15:12:44 +0000 |
commit | cd8ed397a3428b047d5d519a91758cb2f3013282 (patch) | |
tree | 6434da34d0eba17ecda806cdc976203fc19ea90f /sys/geom | |
parent | 49cd513ac9eda3f986bed277a08d87eadc6ca6ba (diff) | |
download | FreeBSD-src-cd8ed397a3428b047d5d519a91758cb2f3013282.zip FreeBSD-src-cd8ed397a3428b047d5d519a91758cb2f3013282.tar.gz |
Make it possible to remove stale, left-over subdisks.
Diffstat (limited to 'sys/geom')
-rw-r--r-- | sys/geom/vinum/geom_vinum_plex.c | 5 | ||||
-rw-r--r-- | sys/geom/vinum/geom_vinum_rm.c | 16 |
2 files changed, 11 insertions, 10 deletions
diff --git a/sys/geom/vinum/geom_vinum_plex.c b/sys/geom/vinum/geom_vinum_plex.c index 9e77693..6f68dd9 100644 --- a/sys/geom/vinum/geom_vinum_plex.c +++ b/sys/geom/vinum/geom_vinum_plex.c @@ -727,7 +727,10 @@ gv_plex_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) /* Now find the correct plex where this subdisk belongs to. */ p = gv_find_plex(sc, s->plex); - KASSERT(p != NULL, ("gv_plex_taste: NULL p")); + if (p == NULL) { + printf("gv_plex_taste: NULL p for '%s'\n", s->name); + return (NULL); + } /* * Add this subdisk to this plex. Since we trust the on-disk diff --git a/sys/geom/vinum/geom_vinum_rm.c b/sys/geom/vinum/geom_vinum_rm.c index f4c191a..bb2b765 100644 --- a/sys/geom/vinum/geom_vinum_rm.c +++ b/sys/geom/vinum/geom_vinum_rm.c @@ -244,21 +244,17 @@ gv_rm_plex(struct gv_softc *sc, struct gctl_req *req, struct gv_plex *p, int fla static int gv_rm_sd(struct gv_softc *sc, struct gctl_req *req, struct gv_sd *s, int flags) { - struct gv_drive *d; - struct g_geom *gp; struct g_provider *pp; KASSERT(s != NULL, ("gv_rm_sd: NULL s")); - d = s->drive_sc; - KASSERT(d != NULL, ("gv_rm_sd: NULL d")); - gp = d->geom; - KASSERT(gp != NULL, ("gv_rm_sd: NULL gp")); pp = s->provider; /* Clean up. */ - LIST_REMOVE(s, in_plex); - LIST_REMOVE(s, from_drive); + if (s->plex_sc) + LIST_REMOVE(s, in_plex); + if (s->drive_sc) + LIST_REMOVE(s, from_drive); LIST_REMOVE(s, sd); gv_free_sd(s); g_free(s); @@ -389,8 +385,10 @@ gv_free_sd(struct gv_sd *s) struct gv_freelist *fl, *fl2; KASSERT(s != NULL, ("gv_free_sd: NULL s")); + d = s->drive_sc; - KASSERT(d != NULL, ("gv_free_sd: NULL d")); + if (d == NULL) + return; /* * First, find the free slot that's immediately before or after this |