Subject: kern/7033: diskerr() prints wrong partition name if MAXPARTITIONS != 8
To: None <gnats-bugs@gnats.netbsd.org>
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
List: netbsd-bugs
Date: 02/22/1999 20:47:28
>Number: 7033
>Category: kern
>Synopsis: diskerr() prints wrong partition name if MAXPARTITIONS != 8
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: kern-bug-people (Kernel Bug People)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Feb 22 03:50:00 1999
>Last-Modified:
>Originator: Izumi Tsutsui
>Organization:
Izumi Tsutsui Himeji City, Japan
>Release: NetBSD-current supped on 19990219
>Environment:
System: NetBSD mirage 1.3I NetBSD 1.3I (MIRAGE) #53: Sat Feb 20 10:20:57 JST \
1999 tsutsui@mirage:/usr/src/sys/arch/i386/compile/MIRAGE i386
>Description:
diskerr() in kern/subr_disk.c prints wrong disk partition name
on arch which has MAXPARTITIONS != 8 like macppc. It uses
dkunit() and dkpart() macros but they assume max partition number is 8.
>How-To-Repeat:
When disk error occured at wd1c on macppc, the kernel reported it as
`wd2c: hard error reading ...'
>Fix:
Replace dkunit() and dkpart() macros with DISKUNIT() and DISKPART()
defined in sys/disklabel.h. dkminor() macro is never used.
--- sys/kern/subr_disk.c.orig Tue Aug 4 20:11:17 1998
+++ sys/kern/subr_disk.c Mon Feb 22 20:19:21 1999
@@ -188,11 +188,6 @@
bq->b_actf = bp;
}
-/* encoding of disk minor numbers, should be elsewhere... */
-#define dkunit(dev) (minor(dev) >> 3)
-#define dkpart(dev) (minor(dev) & 07)
-#define dkminor(unit, part) (((unit) << 3) | (part))
-
/*
* Compute checksum for disk label.
*/
@@ -231,7 +226,7 @@
int pri, blkdone;
register struct disklabel *lp;
{
- int unit = dkunit(bp->b_dev), part = dkpart(bp->b_dev);
+ int unit = DISKUNIT(bp->b_dev), part = DISKPART(bp->b_dev);
register void (*pr) __P((const char *, ...));
char partname = 'a' + part;
int sn;
>Audit-Trail:
>Unformatted: