diff options
author | phk <phk@FreeBSD.org> | 2003-03-03 11:14:36 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-03-03 11:14:36 +0000 |
commit | 31cc9c5b3f2048d7d1bc66a66d5a911d854b29c9 (patch) | |
tree | fa7d9c739c57090e8130d5af0f8cf7ef5c50e2f6 | |
parent | 2b852dbfbd05b0667175d93429fe38a006a2574b (diff) | |
download | FreeBSD-src-31cc9c5b3f2048d7d1bc66a66d5a911d854b29c9.zip FreeBSD-src-31cc9c5b3f2048d7d1bc66a66d5a911d854b29c9.tar.gz |
Don't pick up a name from the dev_t if it is not there.
-rw-r--r-- | sys/kern/subr_disk.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c index 18f0cc7..bc4a513 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; |