summaryrefslogtreecommitdiffstats
path: root/sys/geom
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>2004-05-11 13:17:40 +0000
committersos <sos@FreeBSD.org>2004-05-11 13:17:40 +0000
commit492da9f78578904ce7e841d929c057c81f1203a4 (patch)
tree96049c9dbe336d86d4e5fd904da9a9f814f036e1 /sys/geom
parentdb217681a38d7d6ee9819241ce4cdf0084025446 (diff)
downloadFreeBSD-src-492da9f78578904ce7e841d929c057c81f1203a4.zip
FreeBSD-src-492da9f78578904ce7e841d929c057c81f1203a4.tar.gz
Dont try to finish devstat's if the disk pointer is NULL, this can happen
when a disk has been destroyed but still has outstanding bio's. Reviewed by: phk
Diffstat (limited to 'sys/geom')
-rw-r--r--sys/geom/geom_disk.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c
index aee02eb..0442385 100644
--- a/sys/geom/geom_disk.c
+++ b/sys/geom/geom_disk.c
@@ -189,7 +189,6 @@ g_disk_done(struct bio *bp)
bp->bio_completed = bp->bio_length - bp->bio_resid;
bp2 = bp->bio_parent;
- dp = bp2->bio_to->geom->softc;
if (bp2->bio_error == 0)
bp2->bio_error = bp->bio_error;
bp2->bio_completed += bp->bio_completed;
@@ -197,7 +196,8 @@ g_disk_done(struct bio *bp)
bp2->bio_inbed++;
if (bp2->bio_children == bp2->bio_inbed) {
bp2->bio_resid = bp2->bio_bcount - bp2->bio_completed;
- devstat_end_transaction_bio(dp->d_devstat, bp2);
+ if ((dp = bp2->bio_to->geom->softc))
+ devstat_end_transaction_bio(dp->d_devstat, bp2);
g_io_deliver(bp2, bp2->bio_error);
}
mtx_unlock(&g_disk_done_mtx);
OpenPOWER on IntegriCloud