From 67fd2837cdd46755fb2658caed0a77a5d88f5b2a Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Wed, 21 May 2003 18:52:29 +0000 Subject: [PATCH] Return ENXIO if the softc pointer is NULL, in all likelyhood the disk is in the process of disappearing. Approved by: re/rwats* --- sys/geom/geom_disk.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c index 73c72219854..84ca4098c87 100644 --- a/sys/geom/geom_disk.c +++ b/sys/geom/geom_disk.c @@ -104,6 +104,8 @@ g_disk_access(struct g_provider *pp, int r, int w, int e) w += pp->acw; e += pp->ace; dp = pp->geom->softc; + if (dp == NULL) + return (ENXIO); error = 0; if ((pp->acr + pp->acw + pp->ace) == 0 && (r + w + e) > 0) { if (dp->d_open != NULL) { @@ -193,6 +195,8 @@ g_disk_start(struct bio *bp) off_t off; dp = bp->bio_to->geom->softc; + if (dp == NULL) + g_io_deliver(bp, ENXIO); error = EJUSTRETURN; switch(bp->bio_cmd) { case BIO_DELETE: