diff --git a/sys/geom/vinum/geom_vinum_plex.c b/sys/geom/vinum/geom_vinum_plex.c index 9e77693d702f..6f68dd9bfd22 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 f4c191a4727b..bb2b7659428d 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