Date: Sun, 21 Sep 1997 16:44:40 +0200 (CEST) From: Andre Albsmeier <Andre.Albsmeier@mchp.siemens.de> To: freebsd-stable@freebsd.org Subject: Bug in wd.c when using devfs Message-ID: <199709211444.QAA28591@curry.mchp.siemens.de>
next in thread | raw e-mail | index | archive | help
Hi, when using devfs on 2.2-STABLE with 3 IDE drives, I saw that wd2 doesn't appear in /devs. Instead, when booting, the kernel prints a message that wd0 (yes, wd0) is already present. IMHO this is due to a bug in wd.c: When calling the devfs routines, the variable unit is passed instead of lunit. As far as I am correct, unit refers to the physical unit on the controller wdc which is 0 for wd2. And lunit refers to the logical unit which is 2 for wd2. So the kernel thinks, wd0 should be registered once more and complains. I have attached my changes to wd.c which makes it work. Please tell me if this is correct, and I send in a PR. Maybe, this applies to 2.1 and current, too. Thanks, -Andre *** wd.c.ORI Sun Sep 21 14:38:19 1997 --- wd.c Sun Sep 21 14:50:16 1997 *************** *** 478,492 **** wdtimeout(du); #ifdef DEVFS ! mynor = dkmakeminor(unit, WHOLE_DISK_SLICE, RAW_PART); du->dk_bdev = devfs_add_devswf(&wd_bdevsw, mynor, DV_BLK, UID_ROOT, GID_OPERATOR, 0640, ! "wd%d", unit); du->dk_cdev = devfs_add_devswf(&wd_cdevsw, mynor, DV_CHR, UID_ROOT, GID_OPERATOR, 0640, ! "rwd%d", unit); #endif if (dk_ndrive < DK_NDRIVE) { --- 478,492 ---- wdtimeout(du); #ifdef DEVFS ! mynor = dkmakeminor(lunit, WHOLE_DISK_SLICE, RAW_PART); du->dk_bdev = devfs_add_devswf(&wd_bdevsw, mynor, DV_BLK, UID_ROOT, GID_OPERATOR, 0640, ! "wd%d", lunit); du->dk_cdev = devfs_add_devswf(&wd_cdevsw, mynor, DV_CHR, UID_ROOT, GID_OPERATOR, 0640, ! "rwd%d", lunit); #endif if (dk_ndrive < DK_NDRIVE) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199709211444.QAA28591>