From a9463ba8044f50ce55aa22ca3141d9398d6c317a Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Mon, 3 Mar 2003 11:14:36 +0000 Subject: [PATCH] Don't pick up a name from the dev_t if it is not there. --- sys/kern/subr_disk.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c index 18f0cc7e6175..bc4a51327b75 100644 --- a/sys/kern/subr_disk.c +++ b/sys/kern/subr_disk.c @@ -32,7 +32,13 @@ disk_err(struct bio *bp, const char *what, int blkdone, int nl) { daddr_t sn; - printf("%s: %s ", devtoname(bp->bio_dev), what); + if (bp->bio_dev != NULL) + printf("%s: %s ", devtoname(bp->bio_dev), what); + else if (bp->bio_disk != NULL) + printf("%s%d: %s ", + bp->bio_disk->d_name, bp->bio_disk->d_unit, what); + else + printf("disk??: %s ", what); switch(bp->bio_cmd) { case BIO_READ: printf("cmd=read "); break; case BIO_WRITE: printf("cmd=write "); break;