summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_disk.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-05-21 18:52:29 +0000
committerphk <phk@FreeBSD.org>2003-05-21 18:52:29 +0000
commit8539560193d5a40e03564489a8cf352e40513b7b (patch)
treeb1da48ace3cd2c4daffadaecbc4da5b52e772073 /sys/geom/geom_disk.c
parent6fc42a13358f1d43c4b51c4e827c470812d9a899 (diff)
downloadFreeBSD-src-8539560193d5a40e03564489a8cf352e40513b7b.zip
FreeBSD-src-8539560193d5a40e03564489a8cf352e40513b7b.tar.gz
Return ENXIO if the softc pointer is NULL, in all likelyhood the
disk is in the process of disappearing. Approved by: re/rwats*
Diffstat (limited to 'sys/geom/geom_disk.c')
-rw-r--r--sys/geom/geom_disk.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c
index 73c7221..84ca409 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:
OpenPOWER on IntegriCloud